Alps 1.5.12
Loading...
Searching...
No Matches
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-2019, 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
35class OsiSolverInterface;
36class AbcModel;
37
38//#############################################################################
39
42public:
43 // Default Constructor
45
46 // Constructor with model - assumed before cuts
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
76protected:
77
80private:
81
84
85};
86
89
90class AbcRounding : public AbcHeuristic {
91public:
92
93 // Default Constructor
95
96 // Constructor with model - assumed before cuts
98
99 // Copy constructor
101
102 // Destructor
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
124protected:
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
136private:
139};
140
141
142#endif
143
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...
AbcModel * model_
Model.
virtual ~AbcHeuristic()
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...
virtual AbcHeuristic * clone() const =0
Clone.
AbcHeuristic(AbcModel &model)
AbcHeuristic & operator=(const AbcHeuristic &rhs)
Illegal Assignment operator.
virtual void setModel(AbcModel *model)
update model (This is needed if cliques update matrix etc)
Model class for ALPS Branch and Cut.
Definition AbcModel.h:55
virtual void setModel(AbcModel *model)
update model (This is needed if cliques update matrix etc)
void setSeed(int value)
Set seed.
CoinPackedMatrix matrixByRow_
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...
CoinPackedMatrix matrix_
AbcRounding(const AbcRounding &)
virtual AbcHeuristic * clone() const
Clone.
AbcRounding(AbcModel &model)
AbcRounding & operator=(const AbcRounding &rhs)
Illegal Assignment operator.