gcg::ConsClassifier Class Reference

Detailed Description

Definition at line 53 of file class_consclassifier.h.

#include <class_consclassifier.h>

Public Member Functions

 ConsClassifier (SCIP *scip, const char *name, int nClasses, int nConss)
 
 ConsClassifier (const ConsClassifier *toCopy)
 
 ~ConsClassifier ()
 
int addClass (const char *name, const char *desc, CONS_DECOMPINFO decompInfo)
 
void assignConsToClass (int consindex, int classindex)
 
std::vector< std::vector< int > > getAllSubsets (bool both, bool only_master, bool only_pricing)
 
CONS_DECOMPINFO getClassDecompInfo (int classindex)
 
const char * getClassNameOfCons (int consindex)
 
int getClassOfCons (int consindex)
 
const int * getConssToClasses ()
 
int getNConss ()
 
std::vector< int > getNConssOfClasses ()
 
bool isConsClassified (int consindex)
 
ConsClassifierreduceClasses (int maxNumberOfClasses)
 
void setClassDecompInfo (int classindex, CONS_DECOMPINFO decompInfo)
 
- Public Member Functions inherited from gcg::IndexClassifier
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)
 

Additional Inherited Members

- Protected Member Functions inherited from gcg::IndexClassifier
 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 inherited from gcg::IndexClassifier
SCIP * scip
 

Constructor & Destructor Documentation

gcg::ConsClassifier::ConsClassifier ( SCIP *  _scip,
const char *  givenName,
int  givenNClasses,
int  givenNCons 
)

constructor

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

Definition at line 47 of file class_consclassifier.cpp.

Referenced by reduceClasses().

gcg::ConsClassifier::ConsClassifier ( const ConsClassifier toCopy)

copy constructor

Parameters
toCopyConsClassifier to be copied

Definition at line 59 of file class_consclassifier.cpp.

gcg::ConsClassifier::~ConsClassifier ( )

destructor

Definition at line 66 of file class_consclassifier.cpp.

Member Function Documentation

int gcg::ConsClassifier::addClass ( const char *  givenName,
const char *  givenDesc,
CONS_DECOMPINFO  givenDecompInfo 
)

creates a new class, returns index of the class

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

Definition at line 71 of file class_consclassifier.cpp.

References gcg::IndexClassifier::addClass(), and setClassDecompInfo().

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

void gcg::ConsClassifier::assignConsToClass ( int  givenConsindex,
int  givenClassindex 
)
std::vector< std::vector< int > > gcg::ConsClassifier::getAllSubsets ( bool  both,
bool  only_master,
bool  only_pricing 
)

returns a vector containing all possible subsets of the chosen classindices

Parameters
bothtrue, if BOTH classes should be considered
only_mastertrue, if ONLY_MASTER classes should be considered
only_pricingtrue, if ONLY_PRICING classes should be considered

Definition at line 86 of file class_consclassifier.cpp.

References gcg::BOTH, gcg::IndexClassifier::getAllSubsets(), getClassDecompInfo(), gcg::IndexClassifier::getNClasses(), gcg::ONLY_MASTER, and gcg::ONLY_PRICING.

Referenced by DEC_DECL_PROPAGATESEEED().

CONS_DECOMPINFO gcg::ConsClassifier::getClassDecompInfo ( int  givenClassindex)

returns the decomposition info of a class

returns the decomposition code of a class

Parameters
givenClassindexindex of class

Definition at line 99 of file class_consclassifier.cpp.

References gcg::BOTH, gcg::IndexClassifier::getClassDecompInfo(), gcg::ONLY_MASTER, and gcg::ONLY_PRICING.

Referenced by DEC_DECL_PROPAGATEFROMTOOLBOX(), DEC_DECL_PROPAGATESEEED(), getAllSubsets(), reduceClasses(), and gcg::Seeedpool::translateSeeeds().

const char * gcg::ConsClassifier::getClassNameOfCons ( int  givenConsindex)

returns the name of the class a constraint is assigned to

Parameters
givenConsindexindex of constraint

Definition at line 126 of file class_consclassifier.cpp.

References gcg::IndexClassifier::getClassNameOfIndex().

Referenced by DEC_DECL_PROPAGATEFROMTOOLBOX().

int gcg::ConsClassifier::getClassOfCons ( int  givenConsindex)

returns the index of the class a constraint is assigned to

Parameters
givenConsindexindex of constraint

Definition at line 132 of file class_consclassifier.cpp.

References gcg::IndexClassifier::getClassOfIndex().

Referenced by DEC_DECL_PROPAGATEFROMTOOLBOX(), DEC_DECL_PROPAGATESEEED(), GCGwriteCls(), gcg::Seeed::getDetectorClassifierInfo(), gcg::Seeedpool::printClassifierInformation(), reduceClasses(), and gcg::Seeedpool::translateSeeeds().

const int * gcg::ConsClassifier::getConssToClasses ( )

returns vector containing the assigned class of each constraint

Definition at line 138 of file class_consclassifier.cpp.

References gcg::IndexClassifier::getIndicesToClasses().

std::vector< int > gcg::ConsClassifier::getNConssOfClasses ( )

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

Definition at line 154 of file class_consclassifier.cpp.

References gcg::IndexClassifier::getNIndicesOfClasses().

Referenced by DEC_DECL_PROPAGATEFROMTOOLBOX().

bool gcg::ConsClassifier::isConsClassified ( int  givenConsindex)

returns whether a constraint is already assigned to a class

Parameters
givenConsindexindex of constraint

Definition at line 161 of file class_consclassifier.cpp.

References gcg::IndexClassifier::isIndexClassified().

ConsClassifier * gcg::ConsClassifier::reduceClasses ( int  givenMaxNumber)

returns classifier with reduced number of classes if the current number of classes is greater than an upper bound and lower than 2*(upper bound) (returns NULL otherwise)

returns classifier with reduced number of classes

create new ConsClassifier

reassign conss

set new class names and descriptions (enlarged class has index 0)

Parameters
givenMaxNumberupper bound

Definition at line 167 of file class_consclassifier.cpp.

References assignConsToClass(), gcg::BOTH, ConsClassifier(), getClassDecompInfo(), gcg::IndexClassifier::getClassDescription(), gcg::IndexClassifier::getClassName(), getClassOfCons(), gcg::IndexClassifier::getName(), gcg::IndexClassifier::getNClasses(), getNConss(), gcg::IndexClassifier::reduceClasses(), setClassDecompInfo(), gcg::IndexClassifier::setClassDescription(), and gcg::IndexClassifier::setClassName().

void gcg::ConsClassifier::setClassDecompInfo ( int  givenClassindex,
CONS_DECOMPINFO  givenDecompInfo 
)

sets the decomposition code of a class

Parameters
givenClassindexindex of class
givenDecompInfodecomposition code of class

Definition at line 215 of file class_consclassifier.cpp.

References gcg::BOTH, gcg::ONLY_MASTER, gcg::ONLY_PRICING, and gcg::IndexClassifier::setClassDecompInfo().

Referenced by addClass(), reduceClasses(), and gcg::Seeedpool::translateSeeeds().