Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbcHeuristicDINS.hpp
Go to the documentation of this file.
1 // $Id: CbcHeuristicDINS.hpp 2465 2019-01-03 19:26:52Z unxusr $
2 // Copyright (C) 2006, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 // edwin 12/5/09 carved out of CbcHeuristicRINS
7 
8 #ifndef CbcHeuristicDINS_H
9 #define CbcHeuristicDINS_H
10 
11 #include "CbcHeuristic.hpp"
12 
14 public:
15  // Default Constructor
17 
18  /* Constructor with model - assumed before cuts
19  Initial version does not do Lps
20  */
21  CbcHeuristicDINS(CbcModel &model);
22 
23  // Copy constructor
25 
26  // Destructor
28 
30  virtual CbcHeuristic *clone() const;
31 
34 
36  virtual void generateCpp(FILE *fp);
37 
39  virtual void resetModel(CbcModel *model);
40 
42  virtual void setModel(CbcModel *model);
43 
49  virtual int solution(double &objectiveValue,
50  double *newSolution);
52  int solutionFix(double &objectiveValue,
53  double *newSolution,
54  const int *keep);
55 
57  inline void setHowOften(int value)
58  {
59  howOften_ = value;
60  }
62  inline void setMaximumKeep(int value)
63  {
64  maximumKeepSolutions_ = value;
65  }
67  inline void setConstraint(int value)
68  {
69  localSpace_ = value;
70  }
71 
72 protected:
73  // Data
74 
78  int howOften_;
92  int **values_;
93 };
94 
95 #endif
96 
97 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
98 */
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
virtual void generateCpp(FILE *fp)
Create C++ lines to get to current state.
void setHowOften(int value)
Sets how often to do it.
void setMaximumKeep(int value)
Sets maximum number of solutions kept.
int localSpace_
Local parameter.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
int numberIntegers_
Number of integer variables.
int howOften_
How often to do (code can change)
void setConstraint(int value)
Sets tightness of extra constraint.
int solutionFix(double &objectiveValue, double *newSolution, const int *keep)
This version fixes stuff and does IP.
virtual int solution(double &objectiveValue, double *newSolution)
returns 0 if no solution, 1 if valid solution.
int maximumKeepSolutions_
Maximum number of solutions to keep.
int numberSolutions_
Number of solutions so we can do something at solution.
Heuristic base class.
CbcHeuristicDINS & operator=(const CbcHeuristicDINS &rhs)
Assignment operator.
int numberKeptSolutions_
Number of solutions kept.
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...
int numberTries_
Number of tries.
int numberSuccesses_
Number of successes.
int ** values_
Values of integer variables.
Simple Branch and bound class.
Definition: CbcModel.hpp:100
virtual CbcHeuristic * clone() const
Clone.