Alps 1.5.11
Loading...
Searching...
No Matches
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 * 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 SbbCutGenerator.hpp
25//#############################################################################
26
27#ifndef AbcCutGenerator_h_
28#define AbcCutGenerator_h_
29
30#include "OsiSolverInterface.hpp"
31#include "OsiCuts.hpp"
32
33class AbcModel;
34class OsiRowCut;
35class OsiRowCutDebugger;
36class CglCutGenerator;
37
38//#############################################################################
39
69class AbcCutGenerator {
70
71 public:
72
89 bool generateCuts( OsiCuts &cs, bool fullScan);
91
92
97
99 AbcCutGenerator(AbcModel * model,CglCutGenerator * generator,
100 int howOften=1, const char * name=NULL,
101 bool normal=true, bool atSolution=false,
102 bool infeasible=false);
103
106
109
113
121 void refreshModel(AbcModel * model);
122
124 inline const char * cutGeneratorName() const
125 {
126 return generatorName_;
127 }
128
143 void setHowOften(int value) ;
144
146 inline int howOften() const
147 { return whenCutGenerator_; }
148
150 inline bool normal() const
151 { return normal_; }
153 inline void setNormal(bool value)
154 { normal_=value; }
156 inline bool atSolution() const
157 { return atSolution_; }
159 inline void setAtSolution(bool value)
160 { atSolution_=value; }
164 inline bool whenInfeasible() const
165 { return whenInfeasible_; }
169 inline void setWhenInfeasible(bool value)
170 { whenInfeasible_=value; }
172 inline CglCutGenerator * generator() const
173 { return generator_; }
175
176 private:
179
180 // The CglCutGenerator object
181 CglCutGenerator * generator_;
182
187
189 char * generatorName_;
190
192 bool normal_;
193
195 bool atSolution_;
196
198 bool whenInfeasible_;
199};
200
201#endif
Interface between Abc and Cut Generation Library.
void refreshModel(AbcModel *model)
Set the client model.
bool normal_
Whether to call the generator in the normal place.
const char * cutGeneratorName() const
return name of generator
void setAtSolution(bool value)
Set whether the cut generator should be called when a solution is found.
void setHowOften(int value)
Set the cut generation interval.
~AbcCutGenerator()
Destructor.
bool atSolution_
Whether to call the generator when a new solution is found.
bool generateCuts(OsiCuts &cs, bool fullScan)
Generate cuts for the client model.
char * generatorName_
Name of generator.
int howOften() const
Get the cut generation interval.
void setNormal(bool value)
Set whether the cut generator should be called in the normal place.
AbcCutGenerator(const AbcCutGenerator &)
Copy constructor.
void setWhenInfeasible(bool value)
Set whether the cut generator should be called when the subproblem is found to be infeasible.
AbcModel * model_
The client model.
bool whenInfeasible_
Whether to call generator when a subproblem is found to be infeasible.
CglCutGenerator * generator() const
Get the CglCutGenerator bound to this AbcCutGenerator.
AbcCutGenerator()
Default constructor.
AbcCutGenerator(AbcModel *model, CglCutGenerator *generator, int howOften=1, const char *name=NULL, bool normal=true, bool atSolution=false, bool infeasible=false)
Normal constructor.
AbcCutGenerator & operator=(const AbcCutGenerator &rhs)
Assignment operator.
bool atSolution() const
Get whether the cut generator should be called when a solution is found.
bool whenInfeasible() const
Get whether the cut generator should be called when the subproblem is found to be infeasible.
CglCutGenerator * generator_
bool normal() const
Get whether the cut generator should be called in the normal place.
int whenCutGenerator_
Number of nodes between calls to the CglCutGenerator::generateCuts routine.
Model class for ALPS Branch and Cut.
Definition AbcModel.h:55