Detailed Description
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 () |
| void | setDummynodes (int dummynodes_) |
| int | getDummynodes () const |
| 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()
| gcg::HyperrowGraph< T >::HyperrowGraph | ( | GCG * | gcg, |
| Weights | w ) |
- Parameters
-
gcg GCG data structure w weights for the given graph
Definition at line 54 of file hyperrowgraph_def.h.
References gcg::MatrixGraph< T >::graphiface, gcg::MatrixGraph< T >::MatrixGraph(), and gcg::MatrixGraph< T >::name.
◆ ~HyperrowGraph()
|
virtual |
Definition at line 64 of file hyperrowgraph_def.h.
Member Function Documentation
◆ writeToFile()
|
virtual |
writes the graph to the given file. The format is graph dependent
- Parameters
-
fd filename where the graph should be written to edgeweights whether to write edgeweights
Reimplemented from gcg::MatrixGraph< T >.
Definition at line 74 of file hyperrowgraph_def.h.
References gcg::MatrixGraph< T >::dummynodes, GCGgetOrigprob(), getHyperedgeNodes(), getNEdges(), getNNodes(), i, and j.
◆ getNNodes()
|
virtual |
return the number of nodes
Definition at line 115 of file hyperrowgraph_def.h.
References gcg::MatrixGraph< T >::nvars.
Referenced by getNNeighbors(), and writeToFile().
◆ getNEdges()
|
virtual |
return the number of edges (or hyperedges)
Definition at line 109 of file hyperrowgraph_def.h.
References gcg::MatrixGraph< T >::nconss.
Referenced by getHyperedgeNodes(), and writeToFile().
◆ getNNeighbors()
|
virtual |
return node degree
Definition at line 121 of file hyperrowgraph_def.h.
References assert(), getNNodes(), and i.
◆ getNeighbors()
|
inlinevirtual |
Definition at line 80 of file hyperrowgraph.h.
References gcg::Hypergraph< T >::getNeighbors(), and i.
◆ getHyperedgeNodes()
|
virtual |
Definition at line 132 of file hyperrowgraph_def.h.
References assert(), getNEdges(), and i.
Referenced by createDecompFromPartition(), createPartialdecFromPartition(), createPartialdecFromPartition(), and writeToFile().
◆ readPartition()
|
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
-
filename filename where the partition is stored
Reimplemented from gcg::MatrixGraph< T >.
Definition at line 95 of file hyperrowgraph.h.
References gcg::Hypergraph< T >::readPartition(), and SCIP_CALL().
◆ 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()
|
virtual |
- Parameters
-
decomp decomposition structure to generate
Reimplemented from gcg::MatrixGraph< T >.
Definition at line 144 of file hyperrowgraph_def.h.
References GCGdecompCreate(), GCGfilloutDecompFromConstoblock(), GCGgetOrigprob(), getHyperedgeNodes(), i, gcg::MatrixGraph< T >::nconss, SCIP_CALL(), SCIPdebugMessage(), and SCIPfreeBufferArray().
◆ createPartialdecFromPartition() [1/2]
|
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
-
oldpartialdec partialdec which should be amplifies firstpartialdec pointer to buffer the new partialdec amplified by dint of the graph (can be NULL) secondpartialdec pinter to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL) detprobdata detection process information and data
Reimplemented from gcg::MatrixGraph< T >.
Definition at line 304 of file hyperrowgraph_def.h.
References assert(), c, GCGgetOrigprob(), getHyperedgeNodes(), gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVarsForCons(), i, gcg::MatrixGraph< T >::nconss, gcg::PARTIALDECOMP::PARTIALDECOMP(), SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), and var.
◆ createPartialdecFromPartition() [2/2]
|
virtual |
creates a new partialdec by dint of a graph created with all constraints and variables
- Parameters
-
firstpartialdec pointer to buffer the new partialdec created by dint of the graph (can be NULL) secondpartialdec pointer to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL) detprobdata detection process information and data
Definition at line 212 of file hyperrowgraph_def.h.
References GCGgetOrigprob(), getHyperedgeNodes(), gcg::DETPROBDATA::getIndexForCons(), i, gcg::DETPROBDATA::isAssignedToOrigProb(), gcg::MatrixGraph< T >::nconss, gcg::PARTIALDECOMP::PARTIALDECOMP(), SCIP_CALL(), SCIPdebugMessage(), and SCIPfreeBufferArray().
◆ createFromMatrix()
|
virtual |
- Parameters
-
conss constraints for which graph should be created vars variables 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 assert(), GCGgetOrigprob(), GCGisVarRelevant(), i, j, gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, SCIP_CALL(), SCIPfreeBufferArray(), success, vars, and gcg::MatrixGraph< T >::weights.
◆ createFromPartialMatrix()
|
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
-
detprobdata detection process information and data partialdec partial decomposition to use for matrix
Reimplemented from gcg::MatrixGraph< T >.
Definition at line 526 of file hyperrowgraph_def.h.
References assert(), c, 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(), i, j, gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, var, and gcg::MatrixGraph< T >::weights.