# HG changeset patch # User alpar # Date 1077722799 0 # Node ID 1630a5b631c8a07c582e3c8e9dfabdfedbe7e5fb # Parent f3511cffee1142542cfe43bb540ee3b5cf8759f4 setInvalid() functions added. diff -r f3511cffee11 -r 1630a5b631c8 src/work/alpar/smart_graph.h --- a/src/work/alpar/smart_graph.h Wed Feb 25 12:11:28 2004 +0000 +++ b/src/work/alpar/smart_graph.h Wed Feb 25 15:26:39 2004 +0000 @@ -5,26 +5,29 @@ #include #include +#include namespace hugo { class SmartGraph { - static const int INVALID=-1; + static const int INVALID_EDGE=-1; + static const int INVALID_NODE=INT_MAX; struct NodeT { int first_in,first_out; - NodeT() : first_in(INVALID), first_out(INVALID) {} + NodeT() : first_in(INVALID_EDGE), first_out(INVALID_EDGE) {} }; struct EdgeT { int head, tail, next_in, next_out; //FIXME: is this necessary? - EdgeT() : next_in(INVALID), next_out(INVALID) {} + EdgeT() : next_in(INVALID_EDGE), next_out(INVALID_EDGE) {} }; std::vector nodes; + std::vector edges; template class DynMapBase @@ -123,10 +126,13 @@ return e; } - bool valid(EdgeIt e) const { return e.n!=INVALID; } + bool valid(EdgeIt e) const { return e.n!=INVALID_EDGE; } bool valid(EachEdgeIt e) const { return e.n It next(It it) const // { It tmp(it); return goNext(tmp); } { It tmp; tmp.n=it.n+1; return tmp; }