Detailed Description
Definition at line 46 of file class_indexpartition.h.
#include <class_indexpartition.h>
Public Member Functions | |
bool | isDuplicateOf (IndexPartition *otherPartition) |
const char * | getClassDescription (int classindex) |
const char * | getClassName (int classindex) |
const char * | getName () |
int | getNClasses () |
std::vector< int > | reduceClasses (int maxNumberOfClasses) |
int | removeEmptyClasses () |
void | setClassDescription (int classindex, const char *desc) |
void | setClassName (int classindex, const char *name) |
Protected Member Functions | |
IndexPartition (SCIP *scip, const char *name, int nClasses, int nIndices) | |
IndexPartition (const IndexPartition *toCopy) | |
virtual | ~IndexPartition () |
int | addClass (const char *name, const char *desc) |
void | assignIndexToClass (int index, int classindex) |
std::vector< std::vector< int > > | getAllSubsets (std::vector< int > &classindices) |
int | getClassDecompInfo (int classindex) |
const char * | getClassNameOfIndex (int index) |
int | getClassOfIndex (int index) |
std::vector< int > & | getIndicesToClasses () |
int | getNIndices () |
std::vector< int > | getNIndicesOfClasses () |
bool | isIndexClassified (int index) |
void | setClassDecompInfo (int classindex, int decompInfo) |
Protected Attributes | |
SCIP * | scip |
Constructor & Destructor Documentation
◆ IndexPartition() [1/2]
|
protected |
constructor
- Parameters
-
_scip scip data structure givenName name of partition (will be copied) givenNClasses initial number of classes givenNIndices number of indices to be classified
Definition at line 53 of file class_indexpartition.cpp.
◆ IndexPartition() [2/2]
|
protected |
copy constructor
- Parameters
-
toCopy IndexPartition to be copied
Definition at line 67 of file class_indexpartition.cpp.
References scip.
◆ ~IndexPartition()
|
protectedvirtual |
destructor
Definition at line 87 of file class_indexpartition.cpp.
Member Function Documentation
◆ addClass()
|
protected |
creates a new class, returns index of the class
- Parameters
-
givenName name of the class (will be copied) givenDesc description of the class (will be copied)
Definition at line 92 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::addClass(), and gcg::VarPartition::addClass().
◆ assignIndexToClass()
|
protected |
assigns an index to a class
- Parameters
-
givenIndex index to be assigned givenClassindex index of the class
Definition at line 110 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::assignConsToClass(), and gcg::VarPartition::assignVarToClass().
◆ getAllSubsets()
|
protected |
returns a vector containing all possible subsets of the given classindices
- Parameters
-
givenClassindices classindices to be considered
Definition at line 164 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getAllSubsets(), and gcg::VarPartition::getAllSubsets().
◆ getClassDecompInfo()
|
protected |
returns the decomposition info of the a class
- Parameters
-
givenClassindex index of the class
Definition at line 184 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getClassDecompInfo(), and gcg::VarPartition::getClassDecompInfo().
◆ getClassNameOfIndex()
|
protected |
returns the name of the class an index is assigned to
Definition at line 208 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getClassNameOfCons(), and gcg::VarPartition::getClassNameOfVar().
◆ getClassOfIndex()
|
protected |
returns the index of the class an index is assigned to
Definition at line 218 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getClassOfCons(), gcg::VarPartition::getClassOfVar(), and isDuplicateOf().
◆ getIndicesToClasses()
|
protected |
returns vector containing the assigned class of each index
Definition at line 226 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getConssToClasses(), and gcg::VarPartition::getVarsToClasses().
◆ getNIndices()
|
protected |
returns the number of indices
Definition at line 246 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getNConss(), gcg::VarPartition::getNVars(), and isDuplicateOf().
◆ getNIndicesOfClasses()
|
protected |
returns a vector with the numbers of indices that are assigned to the classes
Definition at line 252 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getNConssOfClasses(), and gcg::VarPartition::getNVarsOfClasses().
◆ isIndexClassified()
|
protected |
returns whether an index is already assigned to a class
Definition at line 268 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::isConsClassified(), isDuplicateOf(), and gcg::VarPartition::isVarClassified().
◆ setClassDecompInfo()
|
protected |
sets the decomposition info of the a class
- Parameters
-
givenClassindex index of the class givenDecompInfo decomposition info
Definition at line 357 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::setClassDecompInfo(), and gcg::VarPartition::setClassDecompInfo().
◆ isDuplicateOf()
bool gcg::IndexPartition::isDuplicateOf | ( | IndexPartition * | otherPartition | ) |
returns true if the other partition has an equivalent index structure, meaning that the partition of the set of constraints is the same ignoring the concrete classindices, classnames, etc.
- Parameters
-
otherPartition other partition to be checked
Definition at line 120 of file class_indexpartition.cpp.
References getClassOfIndex(), getNClasses(), getNIndices(), and isIndexClassified().
◆ getClassDescription()
const char * gcg::IndexPartition::getClassDescription | ( | int | givenClassindex | ) |
returns the information text of a class
- Parameters
-
givenClassindex index of class
Definition at line 192 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
◆ getClassName()
const char * gcg::IndexPartition::getClassName | ( | int | givenClassindex | ) |
returns the name of a class
- Parameters
-
givenClassindex index of class
Definition at line 200 of file class_indexpartition.cpp.
Referenced by DEC_DECL_PROPAGATEPARTIALDEC(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
◆ getName()
const char * gcg::IndexPartition::getName | ( | ) |
returns the name of the partition
Definition at line 233 of file class_indexpartition.cpp.
Referenced by gcg::DETPROBDATA::addConsPartition(), gcg::DETPROBDATA::addVarPartition(), DEC_DECL_CONSCLASSIFY(), DEC_DECL_PROPAGATEPARTIALDEC(), DEC_DECL_VARCLASSIFY(), gcg::ConsPartition::reduceClasses(), gcg::VarPartition::reduceClasses(), reduceConsclasses(), and reduceVarclasses().
◆ getNClasses()
int gcg::IndexPartition::getNClasses | ( | ) |
returns the number of classes the partition provides
Definition at line 240 of file class_indexpartition.cpp.
Referenced by DEC_DECL_CONSCLASSIFY(), DEC_DECL_PROPAGATEPARTIALDEC(), DEC_DECL_VARCLASSIFY(), gcg::ConsPartition::getAllSubsets(), gcg::VarPartition::getAllSubsets(), isDuplicateOf(), gcg::ConsPartition::reduceClasses(), gcg::VarPartition::reduceClasses(), and reduceClasses().
◆ reduceClasses()
std::vector< int > gcg::IndexPartition::reduceClasses | ( | int | givenMaxNumber | ) |
returns a class index mapping for creating a new partition the enlarged class is always the class with index 0 returns empty vector if the current number of classes is lower than an upper bound or greater than 2*(upper bound)
returns a class index mapping for creating a new partition
- Parameters
-
givenMaxNumber upper bound
Definition at line 276 of file class_indexpartition.cpp.
References getNClasses().
Referenced by gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
◆ removeEmptyClasses()
int gcg::IndexPartition::removeEmptyClasses | ( | ) |
removes all classes which do not have any assigned index (classindices may change) returns number of removed classes
removes all classes which do not have any assigned indices (classindices may change) returns number of removed classes
Definition at line 313 of file class_indexpartition.cpp.
Referenced by DEC_DECL_CONSCLASSIFY(), and DEC_DECL_VARCLASSIFY().
◆ setClassDescription()
void gcg::IndexPartition::setClassDescription | ( | int | givenClassindex, |
const char * | givenDesc | ||
) |
sets the information text of a class
- Parameters
-
givenClassindex index of class givenDesc description of class (will be copied)
Definition at line 365 of file class_indexpartition.cpp.
Referenced by DEC_DECL_CONSCLASSIFY(), DEC_DECL_VARCLASSIFY(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
◆ setClassName()
void gcg::IndexPartition::setClassName | ( | int | givenClassindex, |
const char * | givenName | ||
) |
sets the name of a class
- Parameters
-
givenClassindex index of class givenName name of class (will be copied)
Definition at line 373 of file class_indexpartition.cpp.
Referenced by DEC_DECL_CONSCLASSIFY(), DEC_DECL_VARCLASSIFY(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
Field Documentation
◆ scip
|
protected |
scip data structure
Definition at line 50 of file class_indexpartition.h.
Referenced by IndexPartition(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().