Detailed Description
Definition at line 52 of file class_indexpartition.h.
#include <class_indexpartition.h>
Public Member Functions | |
| GCG_EXPORT bool | isDuplicateOf (IndexPartition *otherPartition) |
| GCG_EXPORT const char * | getClassDescription (int classindex) |
| GCG_EXPORT const char * | getClassName (int classindex) |
| GCG_EXPORT const char * | getName () |
| GCG_EXPORT int | getNClasses () |
| GCG_EXPORT std::vector< int > | reduceClasses (int maxNumberOfClasses) |
| GCG_EXPORT int | removeEmptyClasses () |
| GCG_EXPORT void | setClassDescription (int classindex, const char *desc) |
| GCG_EXPORT void | setClassName (int classindex, const char *name) |
Protected Member Functions | |
| IndexPartition (GCG *gcgstruct, 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 | |
| GCG * | gcg |
Constructor & Destructor Documentation
◆ IndexPartition() [1/2]
|
protected |
constructor
- Parameters
-
gcgstruct GCG data structure givenName name of partition (will be copied) givenNClasses initial number of classes givenNIndices number of indices to be classified
Definition at line 54 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::ConsPartition(), gcg::ConsPartition::ConsPartition(), IndexPartition(), isDuplicateOf(), gcg::VarPartition::VarPartition(), and gcg::VarPartition::VarPartition().
◆ IndexPartition() [2/2]
|
protected |
copy constructor
- Parameters
-
toCopy IndexPartition to be copied
Definition at line 68 of file class_indexpartition.cpp.
References assert(), gcg, i, and IndexPartition().
◆ ~IndexPartition()
|
protectedvirtual |
destructor
Definition at line 88 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 93 of file class_indexpartition.cpp.
References assert().
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 111 of file class_indexpartition.cpp.
References assert().
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 165 of file class_indexpartition.cpp.
References j.
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 185 of file class_indexpartition.cpp.
References assert().
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 209 of file class_indexpartition.cpp.
References assert().
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 219 of file class_indexpartition.cpp.
References assert().
Referenced by gcg::ConsPartition::getClassOfCons(), gcg::VarPartition::getClassOfVar(), and isDuplicateOf().
◆ getIndicesToClasses()
|
protected |
returns vector containing the assigned class of each index
Definition at line 227 of file class_indexpartition.cpp.
Referenced by gcg::ConsPartition::getConssToClasses(), and gcg::VarPartition::getVarsToClasses().
◆ getNIndices()
|
protected |
returns the number of indices
Definition at line 247 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 253 of file class_indexpartition.cpp.
References i.
Referenced by gcg::ConsPartition::getNConssOfClasses(), and gcg::VarPartition::getNVarsOfClasses().
◆ isIndexClassified()
|
protected |
returns whether an index is already assigned to a class
Definition at line 269 of file class_indexpartition.cpp.
References assert().
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 358 of file class_indexpartition.cpp.
References assert().
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 121 of file class_indexpartition.cpp.
References assert(), c, getClassOfIndex(), getNClasses(), getNIndices(), i, IndexPartition(), isIndexClassified(), and j.
Referenced by gcg::DETPROBDATA::addConsPartition(), and gcg::DETPROBDATA::addVarPartition().
◆ getClassDescription()
| const char * gcg::IndexPartition::getClassDescription | ( | int | givenClassindex | ) |
returns the information text of a class
- Parameters
-
givenClassindex index of class
Definition at line 193 of file class_indexpartition.cpp.
References assert().
Referenced by gcg::ConsPartition::reduceClasses(), gcg::VarPartition::reduceClasses(), and writeCls().
◆ getClassName()
| const char * gcg::IndexPartition::getClassName | ( | int | givenClassindex | ) |
returns the name of a class
- Parameters
-
givenClassindex index of class
Definition at line 201 of file class_indexpartition.cpp.
References assert().
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), GCG_DECL_PROPAGATEPARTIALDEC(), gcg::ConsPartition::reduceClasses(), gcg::VarPartition::reduceClasses(), and writeCls().
◆ getName()
| const char * gcg::IndexPartition::getName | ( | ) |
returns the name of the partition
Definition at line 234 of file class_indexpartition.cpp.
Referenced by gcg::DETPROBDATA::addConsPartition(), gcg::DETPROBDATA::addVarPartition(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_PROPAGATEPARTIALDEC(), GCG_DECL_PROPAGATEPARTIALDEC(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), gcg::ConsPartition::reduceClasses(), gcg::VarPartition::reduceClasses(), reduceConsclasses(), reduceVarclasses(), and writeCls().
◆ getNClasses()
| int gcg::IndexPartition::getNClasses | ( | ) |
returns the number of classes the partition provides
Definition at line 241 of file class_indexpartition.cpp.
Referenced by GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_PROPAGATEPARTIALDEC(), GCG_DECL_PROPAGATEPARTIALDEC(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), gcg::ConsPartition::getAllSubsets(), gcg::VarPartition::getAllSubsets(), isDuplicateOf(), gcg::ConsPartition::reduceClasses(), reduceClasses(), gcg::VarPartition::reduceClasses(), and writeCls().
◆ 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 277 of file class_indexpartition.cpp.
References assert(), getNClasses(), and i.
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 314 of file class_indexpartition.cpp.
References assert(), i, and j.
Referenced by GCG_DECL_CONSCLASSIFY(), and GCG_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 366 of file class_indexpartition.cpp.
References assert().
Referenced by GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_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 374 of file class_indexpartition.cpp.
References assert().
Referenced by GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_CONSCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), GCG_DECL_VARCLASSIFY(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().
Field Documentation
◆ gcg
|
protected |
GCG data structure
Definition at line 56 of file class_indexpartition.h.
Referenced by IndexPartition().