71 Cut(
size_t n,
FunctionPtr f,
double lb,
double ub,
bool never_delete,
92 double eval(
const double *x,
int *err);
100 void evalScore(
const double *x,
double *vio,
double *score);
130 void write(std::ostream &out)
const;
169 void initInfo_(
bool never_delete,
bool never_disable);
177 typedef std::vector<CutPtr> CutVector;
178 typedef CutVector::iterator CutIterator;
179 typedef CutVector::const_iterator CutConstIterator;
Declare important 'types' used in Minotaur.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Store function, bounds and other information about a cut.
Definition: Cut.h:52
CutInfo * getInfo()
Get pointer to the cut info data structure.
Definition: Cut.h:112
double getUb()
Get ub of the inequality.
Definition: Cut.h:121
double lb_
Lower bound.
Definition: Cut.h:146
double eval(const double *x, int *err)
Evaluate the activity of this cut at a given point.
Definition: Cut.cpp:83
FunctionPtr f_
Pointer to the function of a cut.
Definition: Cut.h:140
double getLb()
Get lb of the inequality.
Definition: Cut.h:115
void evalScore(const double *x, double *vio, double *score)
Evaluate score of this cut at a given point.
Definition: Cut.cpp:88
FunctionPtr getFunction()
Get Function Pointer of the cut.
Definition: Cut.h:109
std::string name_
Name of the cut (could be NULL).
Definition: Cut.h:161
CutInfo info_
Information about the cut.
Definition: Cut.h:143
~Cut()
Destroy.
Definition: Cut.cpp:72
void initInfo_(bool never_delete, bool never_disable)
Initialize the values in info_ data structure.
Definition: Cut.cpp:110
size_t n_
Number of variables in the problem. Used to calculate hash.
Definition: Cut.h:152
ConstraintPtr cons_
Pointer to the constraint. Null if it is disabled.
Definition: Cut.h:137
double fixedScore_
Fixed score of each cut.
Definition: Cut.h:158
Cut()
Empty Constructor.
Definition: Cut.cpp:35
std::string getName()
Get name of the cut.
Definition: Cut.h:118
void evalFixedScore_()
Assign a fixed score to the cut.
Definition: Cut.cpp:101
ConstraintPtr getConstraint()
Get Constraint pointer if this cut is in the problem. Null otherwise.
Definition: Cut.h:106
void writeStats(std::ostream &out) const
Display statistics and information.
Definition: Cut.cpp:143
void setName_(std::string name)
Set name of the cut.
Definition: Cut.h:127
void write(std::ostream &out) const
Display.
Definition: Cut.cpp:131
void applyToProblem(ProblemPtr p)
Add a cut to the problem.
Definition: Cut.cpp:78
LoggerPtr logger_
Logger for display.
Definition: Cut.h:149
double ub_
Upper bound.
Definition: Cut.h:155
void setCons(ConstraintPtr c)
Constraint associated with the cut.
Definition: Cut.h:124
Definition: Function.h:37
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
UInt lastEnabled
No. of times it was removed from problem.
Definition: Cut.h:26
bool neverDisable
If true, never delete cut from pool.
Definition: Cut.h:39
UInt numActive
Updated for cuts disabled in pool.
Definition: Cut.h:30
bool neverDelete
Fixed score (does not change.)
Definition: Cut.h:38
bool inRel
If true, never remove cut from problem.
Definition: Cut.h:40
UInt cntSinceActive
How many iters since it was last disabled.
Definition: Cut.h:28
UInt timesDisabled
No. of times it was moved from pool to problem.
Definition: Cut.h:25
double hash
Definition: Cut.h:34
UInt lastDisabled
How many iters since it was last enabled.
Definition: Cut.h:27
UInt cntSinceViol
Updated for cuts enabled in problem.
Definition: Cut.h:29
double varScore
Hash value of this cut.
Definition: Cut.h:35
int parent_active_cnts
Updated only for cuts in problem.
Definition: Cut.h:31
double fixedScore
Variable score (changes every iteration.)
Definition: Cut.h:36