# HG changeset patch # User hegyi # Date 1095072630 0 # Node ID 1dd3167db0449dda487bf2f58a1a1ad730f8914e # Parent 512e5fd7d38b496d9fbb6a748d02beccf14112a4 There is no runtime debug in path.h diff -r 512e5fd7d38b -r 1dd3167db044 src/hugo/path.h --- a/src/hugo/path.h Mon Sep 13 10:50:28 2004 +0000 +++ b/src/hugo/path.h Mon Sep 13 10:50:30 2004 +0000 @@ -28,8 +28,6 @@ #include #include -#include -//#include namespace hugo { @@ -74,10 +72,6 @@ /// Subpath defined by two nodes. /// \warning It is an error if the two edges are not in order! DirPath(const DirPath &P, const NodeIt &a, const NodeIt &b) { - if(!a.valid() || !b.valid) { - // FIXME: this check should be more elaborate... - fault("DirPath, subpath ctor: invalid bounding nodes"); - } gr = P.gr; edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); } @@ -87,10 +81,6 @@ /// Subpath defined by two edges. Contains edges in [a,b) /// \warning It is an error if the two edges are not in order! DirPath(const DirPath &P, const EdgeIt &a, const EdgeIt &b) { - if (!a.valid() || !b.valid) { - // FIXME: this check should be more elaborate... - fault("DirPath, subpath ctor: invalid bounding nodes"); - } gr = P.gr; edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); } @@ -127,15 +117,11 @@ /// \brief Initializes node iterator to point to the node of a given index. NodeIt& nth(NodeIt &i, int n) const { - if(n<0 || n>int(length())) - fault("DirPath::nth: index out of range"); return i=NodeIt(*this, n); } /// \brief Initializes edge iterator to point to the edge of a given index. EdgeIt& nth(EdgeIt &i, int n) const { - if(n<0 || n>=int(length())) - fault("DirPath::nth: index out of range"); return i=EdgeIt(*this, n); } @@ -148,24 +134,18 @@ template static It& next(It &e) { - if( !e.valid() ) - fault("DirPath::next() on invalid iterator"); return ++e; } /// \brief Returns node iterator pointing to the head node of the /// given edge iterator. NodeIt head(const EdgeIt& e) const { - if( !e.valid() ) - fault("DirPath::head() on invalid iterator"); return NodeIt(*this, e.idx+1); } /// \brief Returns node iterator pointing to the tail node of the /// given edge iterator. NodeIt tail(const EdgeIt& e) const { - if( !e.valid() ) - fault("DirPath::tail() on invalid iterator"); return NodeIt(*this, e.idx); } @@ -312,9 +292,6 @@ ///Push a new edge to the front of the path. ///\sa setStartNode void pushFront(const GraphEdge& e) { - if( !empty() && P.gr->head(e)!=tail() ) { - fault("DirPath::Builder::pushFront: nonincident edge"); - } front.push_back(e); } @@ -323,9 +300,6 @@ ///Push a new edge to the back of the path. ///\sa setStartNode void pushBack(const GraphEdge& e) { - if( !empty() && P.gr->tail(e)!=head() ) { - fault("DirPath::Builder::pushBack: nonincident edge"); - } back.push_back(e); } @@ -440,10 +414,6 @@ /// Subpath defined by two nodes. /// \warning It is an error if the two edges are not in order! UndirPath(const UndirPath &P, const NodeIt &a, const NodeIt &b) { - if(!a.valid() || !b.valid) { - // FIXME: this check should be more elaborate... - fault("UndirPath, subpath ctor: invalid bounding nodes"); - } gr = P.gr; edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); } @@ -453,10 +423,6 @@ /// Subpath defined by two edges. Contains edges in [a,b) /// \warning It is an error if the two edges are not in order! UndirPath(const UndirPath &P, const EdgeIt &a, const EdgeIt &b) { - if(!a.valid() || !b.valid) { - // FIXME: this check should be more elaborate... - fault("UndirPath, subpath ctor: invalid bounding nodes"); - } gr = P.gr; edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); } @@ -493,15 +459,11 @@ /// \brief Initializes node iterator to point to the node of a given index. NodeIt& nth(NodeIt &i, int n) const { - if(n<0 || n>int(length())) - fault("UndirPath::nth: index out of range"); return i=NodeIt(*this, n); } /// \brief Initializes edge iterator to point to the edge of a given index. EdgeIt& nth(EdgeIt &i, int n) const { - if(n<0 || n>=int(length())) - fault("UndirPath::nth: index out of range"); return i=EdgeIt(*this, n); } @@ -514,24 +476,18 @@ template static It& next(It &e) { - if( !e.valid() ) - fault("UndirPath::next() on invalid iterator"); return ++e; } /// \brief Returns node iterator pointing to the head node of the /// given edge iterator. NodeIt head(const EdgeIt& e) const { - if( !e.valid() ) - fault("UndirPath::head() on invalid iterator"); return NodeIt(*this, e.idx+1); } /// \brief Returns node iterator pointing to the tail node of the /// given edge iterator. NodeIt tail(const EdgeIt& e) const { - if( !e.valid() ) - fault("UndirPath::tail() on invalid iterator"); return NodeIt(*this, e.idx); } @@ -676,9 +632,6 @@ ///Push a new edge to the front of the path. ///\sa setStartNode void pushFront(const GraphEdge& e) { - if( !empty() && P.gr->head(e)!=tail() ) { - fault("UndirPath::Builder::pushFront: nonincident edge"); - } front.push_back(e); }