Detailed Description
class gcg::Hypergraph< T >
Definition at line 55 of file hypergraph.h.
#include <hypergraph.h>
Public Member Functions | |
| Hypergraph (GCG *gcgstruct) | |
| void | swap (Hypergraph &other) |
| Hypergraph & | operator= (Hypergraph other) |
| ~Hypergraph () | |
| SCIP_RETCODE | addNode (int i, int weight) |
| SCIP_RETCODE | addHyperedge (std::vector< int > &edge, int weight) |
| SCIP_RETCODE | addNodeToHyperedge (int node, int hedge) |
| int | getNNodes () |
| int | getNHyperedges () |
| int | getNNeighbors (int i) |
| std::vector< int > | getNeighbors (int i) |
| std::vector< int > | getHyperedgeNodes (int i) |
| int | getNHyperedgeNodes (int i) |
| void | setPartition (int i, int ID) |
| SCIP_RETCODE | writeToFile (int fd, SCIP_Bool writeweights) |
| SCIP_RETCODE | readPartition (const char *filename) |
| int | getWeight (int i) |
| int | getHyperedgeWeight (int i) |
| void | setDummynodes (int dummynodes_) |
| int | getDummynodes () const |
| SCIP_RETCODE | flush () |
Public Member Functions inherited from gcg::GraphInterface | |
| GraphInterface () | |
| virtual | ~GraphInterface () |
| virtual std::vector< int > | getPartition () const |
| virtual void | setPartition (int i, int nodeid)=0 |
| virtual SCIP_RETCODE | writeToFile (int fd, SCIP_Bool writeweights)=0 |
| virtual SCIP_RETCODE | readPartition (const char *filename)=0 |
| virtual SCIP_RETCODE | createDecompFromPartition (GCG_DECOMP **decomp) |
| virtual SCIP_RETCODE | flush ()=0 |
Data Fields | |
| std::string | name |
Protected Attributes | |
| GCG * | gcg |
| Graph< T > * | graph |
| std::vector< int > | nodes |
| std::vector< int > | hedges |
| std::vector< int > | mapping |
| int | lastnode |
| int | dummynodes |
Protected Attributes inherited from gcg::GraphInterface | |
| std::vector< int > | partition |
Constructor & Destructor Documentation
◆ Hypergraph()
| gcg::Hypergraph< T >::Hypergraph | ( | GCG * | gcgstruct | ) |
Constructor
- Parameters
-
gcgstruct GCG data structure
Definition at line 46 of file hypergraph_def.h.
References gcg::Hypergraph< T >::graph, NULL, and SCIPdebugMessage.
◆ ~Hypergraph()
| gcg::Hypergraph< T >::~Hypergraph |
Member Function Documentation
◆ swap()
|
inline |
Definition at line 73 of file hypergraph.h.
References gcg::Hypergraph< T >::dummynodes, gcg::Hypergraph< T >::gcg, gcg::Hypergraph< T >::graph, gcg::Hypergraph< T >::hedges, gcg::Hypergraph< T >::lastnode, gcg::Hypergraph< T >::nodes, and gcg::GraphInterface::partition.
Referenced by gcg::Hypergraph< T >::operator=().
◆ operator=()
|
inline |
Definition at line 85 of file hypergraph.h.
References gcg::Hypergraph< T >::swap().
◆ addNode()
| SCIP_RETCODE gcg::Hypergraph< T >::addNode | ( | int | i, |
| int | weight | ||
| ) |
adds the node with the given weight to the graph
Definition at line 76 of file hypergraph_def.h.
References SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
◆ addHyperedge()
| SCIP_RETCODE gcg::Hypergraph< T >::addHyperedge | ( | std::vector< int > & | edge, |
| int | weight | ||
| ) |
adds the edge to the graph
Definition at line 90 of file hypergraph_def.h.
References SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
◆ addNodeToHyperedge()
| SCIP_RETCODE gcg::Hypergraph< T >::addNodeToHyperedge | ( | int | node, |
| int | hedge | ||
| ) |
adds the edge to the graph
Definition at line 109 of file hypergraph_def.h.
◆ getNNodes()
| int gcg::Hypergraph< T >::getNNodes |
return the number of nodes
Definition at line 120 of file hypergraph_def.h.
◆ getNHyperedges()
| int gcg::Hypergraph< T >::getNHyperedges |
return the number of edges (or hyperedges)
Definition at line 125 of file hypergraph_def.h.
Referenced by gcg::GraphAlgorithms< T >::computekMetric(), gcg::GraphAlgorithms< T >::computeMincut(), and gcg::GraphAlgorithms< T >::computeSoed().
◆ getNNeighbors()
| int gcg::Hypergraph< T >::getNNeighbors | ( | int | i | ) |
return the number of neighbor nodes of given node
- Parameters
-
i the given node
Definition at line 130 of file hypergraph_def.h.
◆ getNeighbors()
| std::vector< int > gcg::Hypergraph< T >::getNeighbors | ( | int | i | ) |
return the neighboring nodes of a given node
- Parameters
-
i the given node
Definition at line 136 of file hypergraph_def.h.
References r.
Referenced by gcg::HypercolGraph< T >::getNeighbors(), and gcg::HyperrowGraph< T >::getNeighbors().
◆ getHyperedgeNodes()
| std::vector< int > gcg::Hypergraph< T >::getHyperedgeNodes | ( | int | i | ) |
return the nodes spanned by hyperedge
Definition at line 158 of file hypergraph_def.h.
Referenced by gcg::GraphAlgorithms< T >::computekMetric(), gcg::GraphAlgorithms< T >::computeMincut(), and gcg::GraphAlgorithms< T >::computeSoed().
◆ getNHyperedgeNodes()
| int gcg::Hypergraph< T >::getNHyperedgeNodes | ( | int | i | ) |
return the number of nodes spanned by hyperedge
Definition at line 171 of file hypergraph_def.h.
◆ setPartition()
|
virtual |
assigns partition to a given node
Implements gcg::GraphInterface.
Definition at line 179 of file hypergraph_def.h.
References partition().
◆ writeToFile()
|
virtual |
writes the hypergraph to the given file. The format is hypergraph dependent
write the hypergraph to a file
- Parameters
-
fd filename where the graph should be written to writeweights whether to write weights
Implements gcg::GraphInterface.
Definition at line 186 of file hypergraph_def.h.
References GCGgetOrigprob(), NULL, SCIP_FILECREATEERROR, SCIP_OKAY, and SCIPinfoMessage().
◆ readPartition()
|
virtual |
reads the partition from the given file. The format is hypergraph dependent. The default is a file with one line for each node a
read in the partition from a file
- Parameters
-
filename filename where the partition is stored
Implements gcg::GraphInterface.
Definition at line 220 of file hypergraph_def.h.
References partition(), SCIP_OKAY, SCIP_READERROR, and SCIPerrorMessage.
Referenced by gcg::HypercolGraph< T >::readPartition(), and gcg::HyperrowGraph< T >::readPartition().
◆ getWeight()
| int gcg::Hypergraph< T >::getWeight | ( | int | i | ) |
return the weight of given node
- Parameters
-
i the given node
Definition at line 248 of file hypergraph_def.h.
◆ getHyperedgeWeight()
| int gcg::Hypergraph< T >::getHyperedgeWeight | ( | int | i | ) |
return the weight of given hyperedge
- Parameters
-
i the given hyperedge
Definition at line 257 of file hypergraph_def.h.
Referenced by gcg::GraphAlgorithms< T >::computekMetric(), gcg::GraphAlgorithms< T >::computeMincut(), and gcg::GraphAlgorithms< T >::computeSoed().
◆ setDummynodes()
|
inline |
set the number of dummy nodes
Definition at line 161 of file hypergraph.h.
References gcg::Hypergraph< T >::dummynodes.
◆ getDummynodes()
|
inline |
Definition at line 167 of file hypergraph.h.
References gcg::Hypergraph< T >::dummynodes.
◆ flush()
|
virtual |
Implements gcg::GraphInterface.
Definition at line 267 of file hypergraph_def.h.
Field Documentation
◆ name
| std::string gcg::Hypergraph< T >::name |
Definition at line 57 of file hypergraph.h.
◆ gcg
|
protected |
Definition at line 59 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::swap().
◆ graph
|
protected |
Definition at line 60 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::Hypergraph(), and gcg::Hypergraph< T >::swap().
◆ nodes
|
protected |
Definition at line 61 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::swap().
◆ hedges
|
protected |
Definition at line 62 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::swap().
◆ mapping
|
protected |
Definition at line 63 of file hypergraph.h.
◆ lastnode
|
protected |
Definition at line 64 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::swap().
◆ dummynodes
|
protected |
Definition at line 65 of file hypergraph.h.
Referenced by gcg::Hypergraph< T >::getDummynodes(), gcg::Hypergraph< T >::setDummynodes(), and gcg::Hypergraph< T >::swap().
Public Member Functions inherited from