gcg::IndexClassifier Class Reference

Detailed Description

Definition at line 46 of file class_indexclassifier.h.

#include <class_indexclassifier.h>

Public Member Functions

bool classifierIsDuplicateOfClassifier (IndexClassifier *otherClassifier)
 
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

 IndexClassifier (SCIP *scip, const char *name, int nClasses, int nIndices)
 
 IndexClassifier (const IndexClassifier *toCopy)
 
virtual ~IndexClassifier ()
 
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

gcg::IndexClassifier::IndexClassifier ( SCIP *  _scip,
const char *  givenName,
int  givenNClasses,
int  givenNIndices 
)
protected

constructor

Parameters
_scipscip data structure
givenNamename of classifier (will be copied)
givenNClassesinitial number of classes
givenNIndicesnumber of indices to be classified

Definition at line 53 of file class_indexclassifier.cpp.

gcg::IndexClassifier::IndexClassifier ( const IndexClassifier toCopy)
protected

copy constructor

Parameters
toCopyIndexClassifier to be copied

Definition at line 67 of file class_indexclassifier.cpp.

References scip.

gcg::IndexClassifier::~IndexClassifier ( )
protectedvirtual

destructor

Definition at line 87 of file class_indexclassifier.cpp.

Member Function Documentation

int gcg::IndexClassifier::addClass ( const char *  givenName,
const char *  givenDesc 
)
protected

creates a new class, returns index of the class

Parameters
givenNamename of the class (will be copied)
givenDescdescription of the class (will be copied)

Definition at line 92 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::addClass(), and gcg::VarClassifier::addClass().

void gcg::IndexClassifier::assignIndexToClass ( int  givenIndex,
int  givenClassindex 
)
protected

assigns an index to a class

Parameters
givenIndexindex to be assigned
givenClassindexindex of the class

Definition at line 110 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::assignConsToClass(), and gcg::VarClassifier::assignVarToClass().

bool gcg::IndexClassifier::classifierIsDuplicateOfClassifier ( IndexClassifier otherClassifier)

returns true if the other classifier has an equivalent index structure, meaning that the partition of the set of constraints is the same ignoring the concrete classindices, classnames, etc.

check whether number of indices and classes is the same

check whether index classes in this classifier are subsets of classes in current classifier

check whether index classes in this classifier are strict subsets of classes in current classifier

Parameters
otherClassifierother classifier to be checked

Definition at line 120 of file class_indexclassifier.cpp.

References getClassOfIndex(), getNClasses(), getNIndices(), and isIndexClassified().

Referenced by gcg::Seeedpool::addConsClassifier(), and gcg::Seeedpool::addVarClassifier().

std::vector< std::vector< int > > gcg::IndexClassifier::getAllSubsets ( std::vector< int > &  givenClassindices)
protected

returns a vector containing all possible subsets of the given classindices

Parameters
givenClassindicesclassindices to be considered

Definition at line 164 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::getAllSubsets(), and gcg::VarClassifier::getAllSubsets().

int gcg::IndexClassifier::getClassDecompInfo ( int  givenClassindex)
protected

returns the decomposition info of the a class

Parameters
givenClassindexindex of the class

Definition at line 184 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::getClassDecompInfo(), and gcg::VarClassifier::getClassDecompInfo().

const char * gcg::IndexClassifier::getClassDescription ( int  givenClassindex)
const char * gcg::IndexClassifier::getClassName ( int  givenClassindex)
const char * gcg::IndexClassifier::getClassNameOfIndex ( int  givenIndex)
protected

returns the name of the class an index is assigned to

Definition at line 208 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::getClassNameOfCons(), and gcg::VarClassifier::getClassNameOfVar().

int gcg::IndexClassifier::getClassOfIndex ( int  givenIndex)
protected

returns the index of the class an index is assigned to

Definition at line 218 of file class_indexclassifier.cpp.

Referenced by classifierIsDuplicateOfClassifier(), gcg::ConsClassifier::getClassOfCons(), and gcg::VarClassifier::getClassOfVar().

std::vector< int > gcg::IndexClassifier::getIndicesToClasses ( )
protected

returns vector containing the assigned class of each index

Definition at line 226 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::getConssToClasses(), and gcg::VarClassifier::getVarsToClasses().

int gcg::IndexClassifier::getNIndices ( )
protected

returns the number of indices

Definition at line 246 of file class_indexclassifier.cpp.

Referenced by classifierIsDuplicateOfClassifier(), gcg::ConsClassifier::getNConss(), and gcg::VarClassifier::getNVars().

std::vector< int > gcg::IndexClassifier::getNIndicesOfClasses ( )
protected

returns a vector with the numbers of indices that are assigned to the classes

Definition at line 252 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::getNConssOfClasses(), and gcg::VarClassifier::getNVarsOfClasses().

bool gcg::IndexClassifier::isIndexClassified ( int  givenIndex)
protected

returns whether an index is already assigned to a class

Definition at line 268 of file class_indexclassifier.cpp.

Referenced by classifierIsDuplicateOfClassifier(), gcg::ConsClassifier::isConsClassified(), and gcg::VarClassifier::isVarClassified().

std::vector< int > gcg::IndexClassifier::reduceClasses ( int  givenMaxNumber)

returns a class index mapping for creating a new classifier 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 classifier

count number of indices per class

map the classes with high numbers of assigned indices to new class indices

Parameters
givenMaxNumberupper bound

Definition at line 276 of file class_indexclassifier.cpp.

References getNClasses().

Referenced by gcg::ConsClassifier::reduceClasses(), and gcg::VarClassifier::reduceClasses().

int gcg::IndexClassifier::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

firstly, find empty classes

secondly, update data

Definition at line 313 of file class_indexclassifier.cpp.

Referenced by gcg::Seeedpool::createVarClassifierForObjValueSigns(), and gcg::Seeedpool::translateSeeeds().

void gcg::IndexClassifier::setClassDecompInfo ( int  givenClassindex,
int  givenDecompInfo 
)
protected

sets the decomposition info of the a class

Parameters
givenClassindexindex of the class
givenDecompInfodecomposition info

Definition at line 357 of file class_indexclassifier.cpp.

Referenced by gcg::ConsClassifier::setClassDecompInfo(), and gcg::VarClassifier::setClassDecompInfo().

void gcg::IndexClassifier::setClassDescription ( int  givenClassindex,
const char *  givenDesc 
)
void gcg::IndexClassifier::setClassName ( int  givenClassindex,
const char *  givenName 
)

Member Data Documentation

SCIP* gcg::IndexClassifier::scip
protected

scip data structure

Definition at line 50 of file class_indexclassifier.h.

Referenced by IndexClassifier().