gcg::HyperrowGraph< T > Class Template Reference

Detailed Description

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

Definition at line 48 of file hyperrowgraph.h.

#include <hyperrowgraph.h>

Public Member Functions

 HyperrowGraph (SCIP *scip, 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 (DEC_DECOMP **decomp)
 
virtual SCIP_RETCODE createSeeedFromPartition (Seeed *oldSeeed, Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
 
virtual SCIP_RETCODE createSeeedFromPartition (Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
 
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
 
virtual SCIP_RETCODE createFromPartialMatrix (Seeedpool *seeedpool, Seeed *seeed)
 
- Public Member Functions inherited from gcg::MatrixGraph< T >
 MatrixGraph (SCIP *scip, Weights w)
 
virtual ~MatrixGraph ()
 
void setDummynodes (int dummynodes_)
 
int getDummynodes () const
 
virtual int getNNonzeroes () const
 

Additional Inherited Members

- Public Attributes inherited from gcg::MatrixGraph< T >
std::string name
 
- Protected Attributes inherited from gcg::MatrixGraph< T >
SCIP * scip_
 
int nconss
 
int nvars
 
int dummynodes
 
Weights weights
 
GraphInterfacegraphiface
 
int nnonzeroes
 

Constructor & Destructor Documentation

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

Definition at line 53 of file hyperrowgraph_def.h.

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

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

Definition at line 63 of file hyperrowgraph_def.h.

Member Function Documentation

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createDecompFromPartition ( DEC_DECOMP **  decomp)
virtual
template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createFromMatrix ( SCIP_CONS **  conss,
SCIP_VAR **  vars,
int  nconss_,
int  nvars_ 
)
virtual
Todo:
skip all variables that have a zero coeffient or where all coefficients add to zero
Todo:
Do more then one entry per variable actually work?
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 400 of file hyperrowgraph_def.h.

References gcg::Weights::calculate(), GCGisVarRelevant(), gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, gcg::MatrixGraph< T >::scip_, and gcg::MatrixGraph< T >::weights.

Referenced by gcg::HyperrowGraph< T >::getPartition().

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createFromPartialMatrix ( Seeedpool seeedpool,
Seeed seeed 
)
virtual

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

< 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

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 491 of file hyperrowgraph_def.h.

References gcg::Weights::calculate(), gcg::Seeedpool::getConsForIndex(), gcg::Seeed::getNConss(), gcg::Seeed::getNOpenconss(), gcg::Seeed::getNOpenvars(), gcg::Seeed::getNVars(), gcg::Seeedpool::getNVarsForCons(), gcg::Seeed::getOpenconss(), gcg::Seeed::getOpenvars(), gcg::Seeedpool::getVarForIndex(), gcg::Seeedpool::getVarsForCons(), gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, and gcg::MatrixGraph< T >::weights.

Referenced by gcg::HyperrowGraph< T >::getPartition().

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createSeeedFromPartition ( Seeed oldSeeed,
Seeed **  firstSeeed,
Seeed **  secondSeeed,
Seeedpool seeedpool 
)
virtual

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

stores the conss included by the graph

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

Parameters
oldSeeedseeed which should be amplifies
firstSeeedpointer to buffer the new seeed amplified by dint of the graph
secondSeeedpinter to buffer the new seeed whose border is amplified by dint of the graph

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 284 of file hyperrowgraph_def.h.

References gcg::HyperrowGraph< T >::getHyperedgeNodes(), gcg::Seeed::getNConss(), gcg::Seeed::getNOpenconss(), gcg::Seeed::getNOpenvars(), gcg::Seeedpool::getNVarsForCons(), gcg::Seeed::getOpenconss(), gcg::Seeed::getOpenvars(), gcg::Seeedpool::getVarsForCons(), gcg::MatrixGraph< T >::nconss, partition(), and gcg::MatrixGraph< T >::scip_.

Referenced by gcg::HyperrowGraph< T >::getPartition().

template<class T >
SCIP_RETCODE gcg::HyperrowGraph< T >::createSeeedFromPartition ( Seeed **  firstSeeed,
Seeed **  secondSeeed,
Seeedpool seeedpool 
)
virtual

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

Parameters
firstSeeedpointer to buffer the new seeed created by dint of the graph
secondSeeedpointer to buffer the new seeed whose border is amplified by dint of the graph

Definition at line 210 of file hyperrowgraph_def.h.

References gcg::HyperrowGraph< T >::getHyperedgeNodes(), gcg::Seeedpool::getIndexForCons(), gcg::Seeedpool::getNewIdForSeeed(), gcg::MatrixGraph< T >::nconss, partition(), and gcg::MatrixGraph< T >::scip_.

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

return the number of edges (or hyperedges)

Definition at line 107 of file hyperrowgraph_def.h.

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

Referenced by gcg::HyperrowGraph< T >::getHyperedgeNodes(), and gcg::HyperrowGraph< T >::writeToFile().

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

return node degree

Definition at line 119 of file hyperrowgraph_def.h.

References gcg::HyperrowGraph< T >::getNNodes().

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

return the number of nodes

Definition at line 113 of file hyperrowgraph_def.h.

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

Referenced by gcg::HyperrowGraph< T >::getNNeighbors(), and gcg::HyperrowGraph< T >::writeToFile().

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 94 of file hyperrowgraph.h.

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

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 73 of file hyperrowgraph_def.h.

References gcg::MatrixGraph< T >::dummynodes, gcg::HyperrowGraph< T >::getHyperedgeNodes(), gcg::HyperrowGraph< T >::getNEdges(), gcg::HyperrowGraph< T >::getNNodes(), and gcg::MatrixGraph< T >::scip_.