mirror of https://github.com/CGAL/cgal
Add graph::clear()
This commit is contained in:
parent
017614c1f0
commit
b45e788c0f
|
|
@ -520,6 +520,8 @@ public:
|
||||||
/* Destructor */
|
/* Destructor */
|
||||||
~Graph();
|
~Graph();
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
/* Adds a node to the graph */
|
/* Adds a node to the graph */
|
||||||
node_id add_node();
|
node_id add_node();
|
||||||
|
|
||||||
|
|
@ -701,7 +703,7 @@ inline Graph::Graph(void (*err_function)(const char *))
|
||||||
flow = 0;
|
flow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Graph::~Graph()
|
inline void Graph::clear()
|
||||||
{
|
{
|
||||||
while (node_block_first) {
|
while (node_block_first) {
|
||||||
node_block *next = node_block_first -> next;
|
node_block *next = node_block_first -> next;
|
||||||
|
|
@ -722,6 +724,11 @@ inline Graph::~Graph()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Graph::~Graph()
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
inline Graph::node_id Graph::add_node()
|
inline Graph::node_id Graph::add_node()
|
||||||
{
|
{
|
||||||
node *i;
|
node *i;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public:
|
||||||
|
|
||||||
void clear_graph()
|
void clear_graph()
|
||||||
{
|
{
|
||||||
graph = MaxFlow::Graph();
|
graph.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vertex_descriptor add_vertex()
|
Vertex_descriptor add_vertex()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue