Scippy

GCG

Branch-and-Price & Column Generation for Everyone

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]

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

constructor

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

Definition at line 53 of file class_indexpartition.cpp.

◆ IndexPartition() [2/2]

gcg::IndexPartition::IndexPartition ( const IndexPartition toCopy)
protected

copy constructor

Parameters
toCopyIndexPartition to be copied

Definition at line 67 of file class_indexpartition.cpp.

References scip.

◆ ~IndexPartition()

gcg::IndexPartition::~IndexPartition ( )
protectedvirtual

destructor

Definition at line 87 of file class_indexpartition.cpp.

Member Function Documentation

◆ addClass()

int gcg::IndexPartition::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_indexpartition.cpp.

Referenced by gcg::ConsPartition::addClass(), and gcg::VarPartition::addClass().

◆ assignIndexToClass()

void gcg::IndexPartition::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_indexpartition.cpp.

Referenced by gcg::ConsPartition::assignConsToClass(), and gcg::VarPartition::assignVarToClass().

◆ getAllSubsets()

std::vector< std::vector< int > > gcg::IndexPartition::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_indexpartition.cpp.

Referenced by gcg::ConsPartition::getAllSubsets(), and gcg::VarPartition::getAllSubsets().

◆ getClassDecompInfo()

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

returns the decomposition info of the a class

Parameters
givenClassindexindex of the class

Definition at line 184 of file class_indexpartition.cpp.

Referenced by gcg::ConsPartition::getClassDecompInfo(), and gcg::VarPartition::getClassDecompInfo().

◆ getClassNameOfIndex()

const char * gcg::IndexPartition::getClassNameOfIndex ( int  givenIndex)
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()

int gcg::IndexPartition::getClassOfIndex ( int  givenIndex)
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()

std::vector< int > & gcg::IndexPartition::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()

int gcg::IndexPartition::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()

std::vector< int > gcg::IndexPartition::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()

bool gcg::IndexPartition::isIndexClassified ( int  givenIndex)
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()

void gcg::IndexPartition::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_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
otherPartitionother 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
givenClassindexindex 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
givenClassindexindex of class

Definition at line 200 of file class_indexpartition.cpp.

Referenced by DEC_DECL_PROPAGATEPARTIALDEC(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().

◆ getName()

◆ getNClasses()

◆ 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
givenMaxNumberupper 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
givenClassindexindex of class
givenDescdescription 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
givenClassindexindex of class
givenNamename 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

SCIP* gcg::IndexPartition::scip
protected

scip data structure

Definition at line 50 of file class_indexpartition.h.

Referenced by IndexPartition(), gcg::ConsPartition::reduceClasses(), and gcg::VarPartition::reduceClasses().