Minotaur 0.4.1
Docs for developers
ProbStructure.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
7
14#ifndef MINOTAURPROBSTRUCTURE_H
15#define MINOTAURPROBSTRUCTURE_H
16
17#include <vector>
18
19#include "Problem.h"
20#include "Constraint.h"
21#include "Variable.h"
22#include "Types.h"
23#include "Environment.h"
24
25namespace Minotaur{
26
28{
29 UInt totalcons; // Total number of constraints checked.
30 UInt totalGUBs; // Total number of GUBs obtained.
31};
32
33class ProbStructure;
37typedef ProbStructStats const * ConstProbStructStatsPtr;
38
39typedef std::pair<ConstVariablePtr, ConstConstraintVectorPtr> VarConsPair;
40typedef std::map<ConstVariablePtr, ConstConstraintVectorPtr> VarCons;
41typedef VarCons * VarConsPtr;
42typedef VarCons::iterator VarConsIterator;
43typedef VarCons::const_iterator VarConsConstIterator;
44
45
54public:
57
60
63
66
69
71 void generateLists();
72
74 UInt getNumGUB() const {return list_->size();};
75
78
80 UInt getNumConsChecked() const {return stats_->totalcons;};
81
83 ConstProbStructStatsPtr getStats() const {return stats_;};
84
86 ConstConstraintVectorPtr getVarGUBs(ConstVariablePtr var) const;
87
89 ConstConstraintVectorPtr getGUBs() const {return list_;};
90
91private:
92 // Environment.
93 EnvPtr env_;
94 // Problem that we identify GUB constraints.
95 ProblemPtr p_;
96 // Constraint list that contains the pointers to GUB constraints.
97 ConstConstraintVectorPtr list_;
98 // Vector that contains pair<variable,GUBlist>.
99 VarConsPtr varlist_;
100 // Statistics about GUBs.
101 ProbStructStatsPtr stats_;
102};
103
104} // end of namespace
105
106#endif // MINOTAURPROBSTRUCTURE_H
107
108
109
110
Get information about a constraint in a given Problem.
Define the Environment class.
Declare the base class Modification.
Declare important 'types' used in Minotaur.
Define the Variable class.
The Constraint class is used to manage a constraint.
Definition: Constraint.h:61
Definition: Environment.h:28
Definition: ProbStructure.h:53
UInt getNumGUB() const
Get total number of GUBs.
Definition: ProbStructure.h:74
ProbStructure()
Default constructor.
Definition: ProbStructure.cpp:17
ConstConstraintVectorPtr getVarGUBs(ConstVariablePtr var) const
Get a pointer to the vector that contains GUBs for a given variable.
Definition: ProbStructure.cpp:195
void addConstraint(ConstConstraintPtr cons)
Add a constraint to the lists.
Definition: ProbStructure.cpp:141
~ProbStructure()
Destructor.
Definition: ProbStructure.cpp:37
ConstConstraintVectorPtr getGUBs() const
Get a pointer to the vector that contains GUBs.
Definition: ProbStructure.h:89
void generateLists()
Generate the lists for GUBs and GUBs corresponding to variables.
Definition: ProbStructure.cpp:47
UInt getNumVarGUB(ConstVariablePtr var) const
Get total number of GUBs for a given variable.
Definition: ProbStructure.cpp:180
UInt getNumConsChecked() const
Get total number of constraints checked.
Definition: ProbStructure.h:80
ConstProbStructStatsPtr getStats() const
Get the statistics about GUB identification.
Definition: ProbStructure.h:83
bool evalConstraint(ConstConstraintPtr cons)
Checks if a variable is a GUB constraint.
Definition: ProbStructure.cpp:79
Definition: Problem.h:74
Definition: Variable.h:31
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
Definition: ProbStructure.h:28

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