Scippy

GCG

Branch-and-Price & Column Generation for Everyone

gcg::HyperrowGraph< T > Class Template Reference

Detailed Description

template<class T>
class gcg::HyperrowGraph< T >

Definition at line 49 of file hyperrowgraph.h.

#include <hyperrowgraph.h>

Public Member Functions

 HyperrowGraph (GCG *gcg, Weights w)
 
virtual ~HyperrowGraph ()
 
SCIP_RETCODE writeToFile (int fd, SCIP_Bool edgeweights)
 
virtual int getNNodes ()
 
virtual int getNEdges ()
 
virtual int getNNeighbors (int i)
 
virtual std::vector< int > getNeighbors (int i)
 
virtual std::vector< int > getHyperedgeNodes (int i)
 
virtual SCIP_RETCODE readPartition (const char *filename)
 
virtual std::vector< int > getPartition ()
 
virtual SCIP_RETCODE createDecompFromPartition (GCG_DECOMP **decomp)
 
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
 
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
 
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
 
virtual SCIP_RETCODE createFromPartialMatrix (DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
 
- Public Member Functions inherited from gcg::MatrixGraph< T >
 MatrixGraph (GCG *gcgstruct, Weights w)
 
virtual ~MatrixGraph ()
 
virtual SCIP_RETCODE writeToFile (int fd, SCIP_Bool writeweights)
 
virtual SCIP_RETCODE createDecompFromPartition (GCG_DECOMP **decomp)
 
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
 
virtual SCIP_RETCODE readPartition (const char *filename)
 
void setDummynodes (int dummynodes_)
 
int getDummynodes () const
 
virtual std::vector< int > getPartition ()
 
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
 
virtual SCIP_RETCODE createFromPartialMatrix (DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
 
virtual int getNNonzeroes () const
 

Additional Inherited Members

- Data Fields inherited from gcg::MatrixGraph< T >
std::string name
 
- Protected Attributes inherited from gcg::MatrixGraph< T >
GCG * gcg
 
int nconss
 
int nvars
 
int dummynodes
 
Weights weights
 
GraphInterface * graphiface
 
int nnonzeroes
 

Constructor & Destructor Documentation

◆ HyperrowGraph()

template<class T >
gcg::HyperrowGraph< T >::HyperrowGraph ( GCG *  gcg,
Weights  w 
)
Parameters
gcgGCG data structure
wweights for the given graph

Definition at line 54 of file hyperrowgraph_def.h.

References gcg::MatrixGraph< T >::graphiface, gcg::MatrixGraph< T >::name, and w.

◆ ~HyperrowGraph()

template<class T >
gcg::HyperrowGraph< T >::~HyperrowGraph
virtual

Definition at line 64 of file hyperrowgraph_def.h.

Member Function Documentation

◆ writeToFile()

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::writeToFile ( int  fd,
SCIP_Bool  edgeweights 
)
virtual

writes the graph to the given file. The format is graph dependent

Parameters
fdfilename where the graph should be written to
edgeweightswhether to write edgeweights

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 74 of file hyperrowgraph_def.h.

References GCGgetOrigprob(), NULL, SCIP_FILECREATEERROR, SCIP_OKAY, SCIP_WRITEERROR, and SCIPinfoMessage().

◆ getNNodes()

template<class T >
int gcg::HyperrowGraph< T >::getNNodes
virtual

return the number of nodes

Definition at line 115 of file hyperrowgraph_def.h.

◆ getNEdges()

template<class T >
int gcg::HyperrowGraph< T >::getNEdges
virtual

return the number of edges (or hyperedges)

Definition at line 109 of file hyperrowgraph_def.h.

◆ getNNeighbors()

template<class T >
int gcg::HyperrowGraph< T >::getNNeighbors ( int  i)
virtual

return node degree

Definition at line 121 of file hyperrowgraph_def.h.

◆ getNeighbors()

template<class T >
virtual std::vector< int > gcg::HyperrowGraph< T >::getNeighbors ( int  i)
inlinevirtual

Definition at line 80 of file hyperrowgraph.h.

References gcg::Hypergraph< T >::getNeighbors().

◆ getHyperedgeNodes()

template<class T >
std::vector< int > gcg::HyperrowGraph< T >::getHyperedgeNodes ( int  i)
virtual

Definition at line 132 of file hyperrowgraph_def.h.

◆ readPartition()

template<class T >
virtual SCIP_RETCODE gcg::HyperrowGraph< T >::readPartition ( const char *  filename)
inlinevirtual

reads the partition from the given file. The format is graph dependent. The default is a file with one line for each node a

Parameters
filenamefilename where the partition is stored

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 95 of file hyperrowgraph.h.

References gcg::Hypergraph< T >::readPartition(), SCIP_CALL, and SCIP_OKAY.

◆ getPartition()

template<class T >
virtual std::vector< int > gcg::HyperrowGraph< T >::getPartition ( )
inlinevirtual

return a partition of the nodes

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 104 of file hyperrowgraph.h.

References gcg::GraphInterface::getPartition().

◆ createDecompFromPartition()

◆ createPartialdecFromPartition() [1/2]

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createPartialdecFromPartition ( PARTIALDECOMP *  oldpartialdec,
PARTIALDECOMP **  firstpartialdec,
PARTIALDECOMP **  secondpartialdec,
DETPROBDATA *  detprobdata 
)
virtual

amplifies a partialdec by dint of a graph created with open constraints and open variables of the partialdec

stores the conss included by the graph

< true, if the cons will be part of the graph

Parameters
oldpartialdecpartialdec which should be amplifies
firstpartialdecpointer to buffer the new partialdec amplified by dint of the graph (can be NULL)
secondpartialdecpinter to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL)
detprobdatadetection process information and data

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 304 of file hyperrowgraph_def.h.

References b, BMSclearMemoryArray, FALSE, GCGgetOrigprob(), gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVarsForCons(), NULL, partition(), SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPallocBufferArray, SCIPblkmem(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapInsert(), and TRUE.

◆ createPartialdecFromPartition() [2/2]

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createPartialdecFromPartition ( PARTIALDECOMP **  firstpartialdec,
PARTIALDECOMP **  secondpartialdec,
DETPROBDATA *  detprobdata 
)
virtual

creates a new partialdec by dint of a graph created with all constraints and variables

Parameters
firstpartialdecpointer to buffer the new partialdec created by dint of the graph (can be NULL)
secondpartialdecpointer to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL)
detprobdatadetection process information and data

Definition at line 212 of file hyperrowgraph_def.h.

References BMSclearMemoryArray, FALSE, GCGgetOrigprob(), gcg::DETPROBDATA::getIndexForCons(), gcg::DETPROBDATA::isAssignedToOrigProb(), NULL, partition(), SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPallocBufferArray, SCIPblkmem(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetConss(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapInsert(), and TRUE.

◆ createFromMatrix()

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createFromMatrix ( SCIP_CONS **  conss,
SCIP_VAR **  vars,
int  nconss_,
int  nvars_ 
)
virtual
Parameters
conssconstraints for which graph should be created
varsvariables for which graph should be created
nconss_number of constraints
nvars_number of variables

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 434 of file hyperrowgraph_def.h.

References GCGgetOrigprob(), GCGisVarRelevant(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_TRANSFORMED, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetConsNVars(), SCIPgetConsVars(), SCIPgetStage(), SCIPvarGetProbindex(), and SCIPvarGetProbvar().

◆ createFromPartialMatrix()

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createFromPartialMatrix ( DETPROBDATA *  detprobdata,
PARTIALDECOMP *  partialdec 
)
virtual

creates a graph with open constraints and open variables of the partialdec

< true, if the var will be part of the graph

< true, if the cons will be part of the graph

stores the conss included by the graph

stores the vars included by the graph

Parameters
detprobdatadetection process information and data
partialdecpartial decomposition to use for matrix

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 526 of file hyperrowgraph_def.h.

References gcg::DETPROBDATA::getCons(), gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::PARTIALDECOMP::getNVars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVar(), gcg::DETPROBDATA::getVarsForCons(), and SCIP_OKAY.