Scippy

GCG

Branch-and-Price & Column Generation for Everyone

gcg::MatrixGraph< T > Class Template Reference

Detailed Description

template<class T>
class gcg::MatrixGraph< T >

Definition at line 55 of file matrixgraph.h.

#include <matrixgraph.h>

Public Member Functions

 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
 

Data Fields

std::string name
 

Protected Attributes

GCG * gcg
 
int nconss
 
int nvars
 
int dummynodes
 
Weights weights
 
GraphInterface * graphiface
 
int nnonzeroes
 

Constructor & Destructor Documentation

◆ MatrixGraph()

template<class T >
gcg::MatrixGraph< T >::MatrixGraph ( GCG *  gcgstruct,
Weights  w 
)

Constructor

Parameters
gcgstructGCG data structure
wweights for the given graph

Definition at line 45 of file matrixgraph_def.h.

References NULL, and w.

◆ ~MatrixGraph()

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

Destructor

Definition at line 54 of file matrixgraph_def.h.

Member Function Documentation

◆ writeToFile()

template<class T >
virtual SCIP_RETCODE gcg::MatrixGraph< T >::writeToFile ( int  fd,
SCIP_Bool  writeweights 
)
inlinevirtual

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

Parameters
fdfile descriptor where the graph should be written to
writeweightswhether to write weights

Reimplemented in gcg::HypercolGraph< T >, gcg::HyperrowGraph< T >, and gcg::HyperrowcolGraph< T >.

Definition at line 80 of file matrixgraph.h.

References gcg::MatrixGraph< T >::graphiface, SCIP_CALL, SCIP_OKAY, and gcg::GraphInterface::writeToFile().

Referenced by createMetisFile().

◆ createDecompFromPartition()

template<class T >
virtual SCIP_RETCODE gcg::MatrixGraph< T >::createDecompFromPartition ( GCG_DECOMP **  decomp)
inlinevirtual
Parameters
decompdecomposition structure to generate

Reimplemented in gcg::ColumnGraph< T >, gcg::HypercolGraph< T >, gcg::HyperrowcolGraph< T >, gcg::HyperrowGraph< T >, and gcg::RowGraph< T >.

Definition at line 90 of file matrixgraph.h.

References SCIP_ERROR.

◆ createPartialdecFromPartition()

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

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

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 in gcg::HypercolGraph< T >, gcg::HyperrowcolGraph< T >, gcg::HyperrowGraph< T >, and gcg::RowGraph< T >.

Definition at line 100 of file matrixgraph.h.

References SCIP_ERROR.

Referenced by detection().

◆ readPartition()

template<class T >
virtual SCIP_RETCODE gcg::MatrixGraph< 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 in gcg::HypercolGraph< T >, gcg::HyperrowcolGraph< T >, and gcg::HyperrowGraph< T >.

Definition at line 114 of file matrixgraph.h.

References gcg::MatrixGraph< T >::graphiface, gcg::GraphInterface::readPartition(), SCIP_CALL, and SCIP_OKAY.

Referenced by callMetis().

◆ setDummynodes()

template<class T >
void gcg::MatrixGraph< T >::setDummynodes ( int  dummynodes_)
inline

set the number of dummy nodes

Definition at line 123 of file matrixgraph.h.

References gcg::MatrixGraph< T >::dummynodes.

Referenced by createMetisFile().

◆ getDummynodes()

template<class T >
int gcg::MatrixGraph< T >::getDummynodes ( ) const
inline

Definition at line 128 of file matrixgraph.h.

References gcg::MatrixGraph< T >::dummynodes.

◆ getPartition()

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

return a partition of the nodes

Reimplemented in gcg::HyperrowGraph< T >.

Definition at line 134 of file matrixgraph.h.

References gcg::GraphInterface::getPartition(), and gcg::MatrixGraph< T >::graphiface.

◆ createFromMatrix()

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

Reimplemented in gcg::HyperrowcolGraph< T >, gcg::BipartiteGraph< T >, gcg::ColumnGraph< T >, gcg::HypercolGraph< T >, gcg::HyperrowGraph< T >, and gcg::RowGraph< T >.

Definition at line 139 of file matrixgraph.h.

References SCIP_ERROR.

◆ createFromPartialMatrix()

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

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

Reimplemented in gcg::BipartiteGraph< T >, gcg::HypercolGraph< T >, gcg::HyperrowcolGraph< T >, and gcg::HyperrowGraph< T >.

Definition at line 147 of file matrixgraph.h.

References SCIP_ERROR.

Referenced by detection().

◆ getNNonzeroes()

template<class T >
virtual int gcg::MatrixGraph< T >::getNNonzeroes ( ) const
inlinevirtual

Definition at line 153 of file matrixgraph.h.

References gcg::MatrixGraph< T >::nnonzeroes.

Referenced by createMetisFile(), and detection().

Field Documentation

◆ name

◆ gcg

template<class T >
GCG* gcg::MatrixGraph< T >::gcg
protected

Definition at line 59 of file matrixgraph.h.

◆ nconss

template<class T >
int gcg::MatrixGraph< T >::nconss
protected

Definition at line 60 of file matrixgraph.h.

◆ nvars

template<class T >
int gcg::MatrixGraph< T >::nvars
protected

Definition at line 61 of file matrixgraph.h.

◆ dummynodes

template<class T >
int gcg::MatrixGraph< T >::dummynodes
protected

◆ weights

template<class T >
Weights gcg::MatrixGraph< T >::weights
protected

Definition at line 63 of file matrixgraph.h.

◆ graphiface

◆ nnonzeroes

template<class T >
int gcg::MatrixGraph< T >::nnonzeroes
protected

Definition at line 65 of file matrixgraph.h.

Referenced by gcg::MatrixGraph< T >::getNNonzeroes().