34 #ifndef _CYMEALG_DIGRAPHTAB_H_ 35 #define _CYMEALG_DIGRAPHTAB_H_ 38 #include "chomp/system/config.h" 44 template <
class Graph,
class Table>
47 int_t nEdges (g. countEdges ());
48 for (int_t i = 0; i < nEdges; ++ i)
49 g. setWeight (i, tab [i]);
55 template <
class Graph,
class Table>
58 int_t nEdges (g. countEdges ());
59 for (int_t i = 0; i < nEdges; ++ i)
60 tab [i] = g. getWeight (i);
68 template <
class Graph,
class Table>
71 int_t nVertices (g. countVertices ());
73 for (int_t curVertex = 0; curVertex < nVertices; ++ curVertex)
75 int_t nEdges = g. countEdges (curVertex);
76 for (int_t i = 0; i < nEdges; ++ i)
78 tab [curEdge] [0] = curVertex;
79 tab [curEdge] [1] = g. getEdge (curVertex, i);
89 #endif // _CYMEALG_DIGRAPHTAB_H_
void setWeights(Graph &g, const Table &tab)
Sets the weights of all the edges at a time.
void getWeights(const Graph &g, Table &tab)
Gets the weights of all the edges at a time.
void writeEdges(const Graph &g, Table &tab)
Fills out a table that represents all the edges of the graph.