- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

AbcHeuristic.h
Go to the documentation of this file.
1 /*===========================================================================*
2 * This file is part of the Abstract Library for Parallel Search (ALPS). *
3 * *
4 * ALPS is distributed under the Eclipse Public License as part of the *
5 * COIN-OR repository (http://www.coin-or.org). *
6 * *
7 * Authors: *
8 * *
9 * Yan Xu, Lehigh University *
10 * Ted Ralphs, Lehigh University *
11 * *
12 * Conceptual Design: *
13 * *
14 * Yan Xu, Lehigh University *
15 * Ted Ralphs, Lehigh University *
16 * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17 * Matthew Saltzman, Clemson University *
18 * *
19 * *
20 * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21 *===========================================================================*/
22
23 //#############################################################################
24 // This file is modified from SbbHeuristic.hpp
25 //#############################################################################
26
27 #ifndef AbcHeuristic_h_
28 #define AbcHeuristic_h_
29
30 #include <string>
31 #include <vector>
32 #include "CoinPackedMatrix.hpp"
33 #include "OsiCuts.hpp"
34
35 class OsiSolverInterface;
36 class AbcModel;
37
38 //#############################################################################
39
41 class AbcHeuristic {
42 public:
43 // Default Constructor
44 AbcHeuristic ();
45
46 // Constructor with model - assumed before cuts
47 AbcHeuristic (AbcModel & model);
48
49 virtual ~AbcHeuristic();
50
52 virtual void setModel(AbcModel * model);
53
55 virtual AbcHeuristic * clone() const=0;
56
62 virtual int solution(double & objectiveValue,
63 double * newSolution)=0;
64
72 virtual int solution(double & objectiveValue,
73 double * newSolution,
74 OsiCuts & cs) {return 0;}
75
76 protected:
77
79 AbcModel * model_;
80 private:
81
83 AbcHeuristic & operator=(const AbcHeuristic& rhs);
84
85 };
86
90 class AbcRounding : public AbcHeuristic {
91 public:
92
93 // Default Constructor
94 AbcRounding ();
95
96 // Constructor with model - assumed before cuts
97 AbcRounding (AbcModel & model);
98
99 // Copy constructor
100 AbcRounding ( const AbcRounding &);
101
102 // Destructor
103 ~AbcRounding ();
104
106 virtual AbcHeuristic * clone() const;
107
109 virtual void setModel(AbcModel * model);
110
116 virtual int solution(double & objectiveValue,
117 double * newSolution);
118
119
121 void setSeed(int value)
122 { seed_ = value;}
123
124 protected:
125 // Data
126
127 // Original matrix by column
128 CoinPackedMatrix matrix_;
129
130 // Original matrix by
131 CoinPackedMatrix matrixByRow_;
132
133 // Seed for random stuff
134 int seed_;
135
136 private:
138 AbcRounding & operator=(const AbcRounding& rhs);
139 };
140
141
142 #endif
143
CoinPackedMatrix.hpp
AbcHeuristic::solution
virtual int solution(double &objectiveValue, double *newSolution)=0
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
AbcHeuristic::~AbcHeuristic
virtual ~AbcHeuristic()
AbcRounding::clone
virtual AbcHeuristic * clone() const
Clone.
AbcRounding::operator=
AbcRounding & operator=(const AbcRounding &rhs)
Illegal Assignment operator.
AbcRounding::AbcRounding
AbcRounding()
AbcRounding::solution
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets sol...
AbcRounding::setModel
virtual void setModel(AbcModel *model)
update model (This is needed if cliques update matrix etc)
CoinPackedMatrix
Sparse Matrix Base Class.
Definition: CoinPackedMatrix.hpp:79
AbcHeuristic
Heuristic base class.
Definition: AbcHeuristic.h:41
AbcRounding::matrix_
CoinPackedMatrix matrix_
Definition: AbcHeuristic.h:128
OsiCuts
Collections of row cuts and column cuts.
Definition: OsiCuts.hpp:19
AbcHeuristic::AbcHeuristic
AbcHeuristic()
AbcRounding::~AbcRounding
~AbcRounding()
AbcHeuristic::model_
AbcModel * model_
Model.
Definition: AbcHeuristic.h:79
OsiSolverInterface
Abstract Base Class for describing an interface to a solver.
Definition: OsiSolverInterface.hpp:62
AbcRounding::seed_
int seed_
Definition: AbcHeuristic.h:134
AbcHeuristic::clone
virtual AbcHeuristic * clone() const =0
Clone.
AbcRounding::matrixByRow_
CoinPackedMatrix matrixByRow_
Definition: AbcHeuristic.h:131
AbcRounding
Rounding class.
Definition: AbcHeuristic.h:90
AbcHeuristic::operator=
AbcHeuristic & operator=(const AbcHeuristic &rhs)
Illegal Assignment operator.
AbcHeuristic::solution
virtual int solution(double &objectiveValue, double *newSolution, OsiCuts &cs)
returns 0 if no solution, 1 if valid solution, -1 if just returning an estimate of best possible solu...
Definition: AbcHeuristic.h:72
AbcHeuristic::setModel
virtual void setModel(AbcModel *model)
update model (This is needed if cliques update matrix etc)
OsiCuts.hpp
AbcRounding::setSeed
void setSeed(int value)
Set seed.
Definition: AbcHeuristic.h:121
AbcModel
Model class for ALPS Branch and Cut.
Definition: AbcModel.h:55