Alps  2.0.2
AbcCutGenerator.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  * Aykut Bulut, Lehigh University *
11  * Ted Ralphs, Lehigh University *
12  * *
13  * Conceptual Design: *
14  * *
15  * Yan Xu, Lehigh University *
16  * Ted Ralphs, Lehigh University *
17  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
18  * Matthew Saltzman, Clemson University *
19  * *
20  * *
21  * Copyright (C) 2001-2019, Lehigh University, Yan Xu, Aykut Bulut, and *
22  * Ted Ralphs. *
23  * All Rights Reserved. *
24  *===========================================================================*/
25 
26 
27 //#############################################################################
28 // This file is modified from SbbCutGenerator.hpp
29 //#############################################################################
30 
31 #ifndef AbcCutGenerator_h_
32 #define AbcCutGenerator_h_
33 
34 #include "OsiSolverInterface.hpp"
35 #include "OsiCuts.hpp"
36 
37 class AbcModel;
38 class OsiRowCut;
39 class OsiRowCutDebugger;
40 class CglCutGenerator;
41 
42 //#############################################################################
43 
74 
75  public:
76 
93  bool generateCuts( OsiCuts &cs, bool fullScan);
95 
96 
99  AbcCutGenerator ();
101 
103  AbcCutGenerator(AbcModel * model,CglCutGenerator * generator,
104  int howOften=1, const char * name=NULL,
105  bool normal=true, bool atSolution=false,
106  bool infeasible=false);
107 
110 
113 
115  ~AbcCutGenerator ();
117 
125  void refreshModel(AbcModel * model);
126 
128  inline const char * cutGeneratorName() const
129  {
130  return generatorName_;
131  }
132 
147  void setHowOften(int value) ;
148 
150  inline int howOften() const
151  { return whenCutGenerator_; }
152 
154  inline bool normal() const
155  { return normal_; }
157  inline void setNormal(bool value)
158  { normal_=value; }
160  inline bool atSolution() const
161  { return atSolution_; }
163  inline void setAtSolution(bool value)
164  { atSolution_=value; }
168  inline bool whenInfeasible() const
169  { return whenInfeasible_; }
173  inline void setWhenInfeasible(bool value)
174  { whenInfeasible_=value; }
176  inline CglCutGenerator * generator() const
177  { return generator_; }
179 
180  private:
183 
184  // The CglCutGenerator object
185  CglCutGenerator * generator_;
186 
191 
194 
196  bool normal_;
197 
200 
203 };
204 
205 #endif
AbcCutGenerator::setNormal
void setNormal(bool value)
Set whether the cut generator should be called in the normal place.
Definition: AbcCutGenerator.h:157
AbcCutGenerator::~AbcCutGenerator
~AbcCutGenerator()
Destructor.
AbcCutGenerator::generator_
CglCutGenerator * generator_
Definition: AbcCutGenerator.h:185
AbcCutGenerator::atSolution_
bool atSolution_
Whether to call the generator when a new solution is found.
Definition: AbcCutGenerator.h:199
AbcCutGenerator::generatorName_
char * generatorName_
Name of generator.
Definition: AbcCutGenerator.h:193
AbcCutGenerator::refreshModel
void refreshModel(AbcModel *model)
Set the client model.
AbcCutGenerator::whenInfeasible_
bool whenInfeasible_
Whether to call generator when a subproblem is found to be infeasible.
Definition: AbcCutGenerator.h:202
AbcCutGenerator::operator=
AbcCutGenerator & operator=(const AbcCutGenerator &rhs)
Assignment operator.
AbcCutGenerator::cutGeneratorName
const char * cutGeneratorName() const
return name of generator
Definition: AbcCutGenerator.h:128
AbcCutGenerator::normal
bool normal() const
Get whether the cut generator should be called in the normal place.
Definition: AbcCutGenerator.h:154
AbcCutGenerator::generateCuts
bool generateCuts(OsiCuts &cs, bool fullScan)
Generate cuts for the client model.
AbcCutGenerator::AbcCutGenerator
AbcCutGenerator()
Default constructor.
AbcCutGenerator::setAtSolution
void setAtSolution(bool value)
Set whether the cut generator should be called when a solution is found.
Definition: AbcCutGenerator.h:163
AbcCutGenerator::whenInfeasible
bool whenInfeasible() const
Get whether the cut generator should be called when the subproblem is found to be infeasible.
Definition: AbcCutGenerator.h:168
AbcCutGenerator::whenCutGenerator_
int whenCutGenerator_
Number of nodes between calls to the CglCutGenerator::generateCuts routine.
Definition: AbcCutGenerator.h:190
AbcCutGenerator::generator
CglCutGenerator * generator() const
Get the CglCutGenerator bound to this AbcCutGenerator.
Definition: AbcCutGenerator.h:176
AbcCutGenerator::setHowOften
void setHowOften(int value)
Set the cut generation interval.
AbcModel
Model class for ALPS Branch and Cut.
Definition: AbcModel.h:59
AbcCutGenerator::model_
AbcModel * model_
The client model.
Definition: AbcCutGenerator.h:182
AbcCutGenerator::howOften
int howOften() const
Get the cut generation interval.
Definition: AbcCutGenerator.h:150
AbcCutGenerator
Interface between Abc and Cut Generation Library.
Definition: AbcCutGenerator.h:73
AbcCutGenerator::atSolution
bool atSolution() const
Get whether the cut generator should be called when a solution is found.
Definition: AbcCutGenerator.h:160
AbcCutGenerator::setWhenInfeasible
void setWhenInfeasible(bool value)
Set whether the cut generator should be called when the subproblem is found to be infeasible.
Definition: AbcCutGenerator.h:173
AbcCutGenerator::normal_
bool normal_
Whether to call the generator in the normal place.
Definition: AbcCutGenerator.h:196