Minotaur 0.4.1
Docs for developers
CutInfo.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2010 - 2025 The Minotaur Team.
5//
6
14#ifndef MINOTAURCUTINFO_H
15#define MINOTAURCUTINFO_H
16
17#include "Types.h"
18
19namespace Minotaur {
20
21 class Engine;
22 typedef Engine* EnginePtr;
23
29 class CutInfo {
30
31 public:
33 CutInfo();
34
36 CutInfo(ConstraintPtr c, const double* hashval);
37
40
42 void evalScore(const double *x, double &vio, double &score);
43
45 void write(std::ostream &out) const;
46
48 void write() const {write(std::cout);}
49
51 void updateActive(bool wasactive) {
52 if (wasactive) {
54 numActive_++;
55 }
56 else cntSinceActive_++;
57 }
58
60 void updateViol(bool wasviol) {
61 if (wasviol) cntSinceViol_ = 0;
62 else cntSinceViol_++;
63 }
64
67 UInt getCntSinceViol() { return cntSinceViol_;}
68 UInt getNumActive() { return numActive_;}
69 double getHashVal() { return hashVal_;}
70
71 protected:
72
73 void evalFixedScore();
74
77
80
83
86
89
92
94 double hashVal_;
95
96
97 };
98 typedef CutInfo* CutInfoPtr;
99 typedef std::vector< CutInfoPtr > CutInfoVector;
100 typedef CutInfoVector::iterator CutInfoIterator;
101 typedef CutInfoVector::const_iterator CutInfoConstIterator;
102}
103#endif
104
Declare important 'types' used in Minotaur.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
Definition: Cut.h:23
UInt cntSinceActive_
For cuts in relaxation,.
Definition: CutInfo.h:82
CutInfo()
Default Constructor.
Definition: CutInfo.cpp:25
void evalScore(const double *x, double &vio, double &score)
By how much does a given point x violate this cut.
Definition: CutInfo.cpp:68
ConstraintPtr cons_
Pointer to the constraint.
Definition: CutInfo.h:76
void write() const
Write to std::cout.
Definition: CutInfo.h:48
double hashVal_
To check duplicacy.
Definition: CutInfo.h:94
bool canDelete_
True if allowed to delete the cut.
Definition: CutInfo.h:79
UInt getCntSinceActive()
Get basic info.
Definition: CutInfo.h:66
void updateActive(bool wasactive)
Update active counts.
Definition: CutInfo.h:51
void updateViol(bool wasviol)
Update viol counts.
Definition: CutInfo.h:60
~CutInfo()
Destroy.
UInt numActive_
Total number of relaxations where it was active.
Definition: CutInfo.h:88
double fixedScore_
Score.
Definition: CutInfo.h:91
void evalFixedScore()
Definition: CutInfo.cpp:63
UInt cntSinceViol_
For cuts in pool.
Definition: CutInfo.h:85

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025