1.1 --- a/src/hugo/path.h Mon Sep 13 10:50:28 2004 +0000
1.2 +++ b/src/hugo/path.h Mon Sep 13 10:50:30 2004 +0000
1.3 @@ -28,8 +28,6 @@
1.4 #include <algorithm>
1.5
1.6 #include <hugo/invalid.h>
1.7 -#include <hugo/error.h>
1.8 -//#include <hugo/debug.h>
1.9
1.10 namespace hugo {
1.11
1.12 @@ -74,10 +72,6 @@
1.13 /// Subpath defined by two nodes.
1.14 /// \warning It is an error if the two edges are not in order!
1.15 DirPath(const DirPath &P, const NodeIt &a, const NodeIt &b) {
1.16 - if(!a.valid() || !b.valid) {
1.17 - // FIXME: this check should be more elaborate...
1.18 - fault("DirPath, subpath ctor: invalid bounding nodes");
1.19 - }
1.20 gr = P.gr;
1.21 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
1.22 }
1.23 @@ -87,10 +81,6 @@
1.24 /// Subpath defined by two edges. Contains edges in [a,b)
1.25 /// \warning It is an error if the two edges are not in order!
1.26 DirPath(const DirPath &P, const EdgeIt &a, const EdgeIt &b) {
1.27 - if (!a.valid() || !b.valid) {
1.28 - // FIXME: this check should be more elaborate...
1.29 - fault("DirPath, subpath ctor: invalid bounding nodes");
1.30 - }
1.31 gr = P.gr;
1.32 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
1.33 }
1.34 @@ -127,15 +117,11 @@
1.35
1.36 /// \brief Initializes node iterator to point to the node of a given index.
1.37 NodeIt& nth(NodeIt &i, int n) const {
1.38 - if(n<0 || n>int(length()))
1.39 - fault("DirPath::nth: index out of range");
1.40 return i=NodeIt(*this, n);
1.41 }
1.42
1.43 /// \brief Initializes edge iterator to point to the edge of a given index.
1.44 EdgeIt& nth(EdgeIt &i, int n) const {
1.45 - if(n<0 || n>=int(length()))
1.46 - fault("DirPath::nth: index out of range");
1.47 return i=EdgeIt(*this, n);
1.48 }
1.49
1.50 @@ -148,24 +134,18 @@
1.51 template<typename It>
1.52 static
1.53 It& next(It &e) {
1.54 - if( !e.valid() )
1.55 - fault("DirPath::next() on invalid iterator");
1.56 return ++e;
1.57 }
1.58
1.59 /// \brief Returns node iterator pointing to the head node of the
1.60 /// given edge iterator.
1.61 NodeIt head(const EdgeIt& e) const {
1.62 - if( !e.valid() )
1.63 - fault("DirPath::head() on invalid iterator");
1.64 return NodeIt(*this, e.idx+1);
1.65 }
1.66
1.67 /// \brief Returns node iterator pointing to the tail node of the
1.68 /// given edge iterator.
1.69 NodeIt tail(const EdgeIt& e) const {
1.70 - if( !e.valid() )
1.71 - fault("DirPath::tail() on invalid iterator");
1.72 return NodeIt(*this, e.idx);
1.73 }
1.74
1.75 @@ -312,9 +292,6 @@
1.76 ///Push a new edge to the front of the path.
1.77 ///\sa setStartNode
1.78 void pushFront(const GraphEdge& e) {
1.79 - if( !empty() && P.gr->head(e)!=tail() ) {
1.80 - fault("DirPath::Builder::pushFront: nonincident edge");
1.81 - }
1.82 front.push_back(e);
1.83 }
1.84
1.85 @@ -323,9 +300,6 @@
1.86 ///Push a new edge to the back of the path.
1.87 ///\sa setStartNode
1.88 void pushBack(const GraphEdge& e) {
1.89 - if( !empty() && P.gr->tail(e)!=head() ) {
1.90 - fault("DirPath::Builder::pushBack: nonincident edge");
1.91 - }
1.92 back.push_back(e);
1.93 }
1.94
1.95 @@ -440,10 +414,6 @@
1.96 /// Subpath defined by two nodes.
1.97 /// \warning It is an error if the two edges are not in order!
1.98 UndirPath(const UndirPath &P, const NodeIt &a, const NodeIt &b) {
1.99 - if(!a.valid() || !b.valid) {
1.100 - // FIXME: this check should be more elaborate...
1.101 - fault("UndirPath, subpath ctor: invalid bounding nodes");
1.102 - }
1.103 gr = P.gr;
1.104 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
1.105 }
1.106 @@ -453,10 +423,6 @@
1.107 /// Subpath defined by two edges. Contains edges in [a,b)
1.108 /// \warning It is an error if the two edges are not in order!
1.109 UndirPath(const UndirPath &P, const EdgeIt &a, const EdgeIt &b) {
1.110 - if(!a.valid() || !b.valid) {
1.111 - // FIXME: this check should be more elaborate...
1.112 - fault("UndirPath, subpath ctor: invalid bounding nodes");
1.113 - }
1.114 gr = P.gr;
1.115 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
1.116 }
1.117 @@ -493,15 +459,11 @@
1.118
1.119 /// \brief Initializes node iterator to point to the node of a given index.
1.120 NodeIt& nth(NodeIt &i, int n) const {
1.121 - if(n<0 || n>int(length()))
1.122 - fault("UndirPath::nth: index out of range");
1.123 return i=NodeIt(*this, n);
1.124 }
1.125
1.126 /// \brief Initializes edge iterator to point to the edge of a given index.
1.127 EdgeIt& nth(EdgeIt &i, int n) const {
1.128 - if(n<0 || n>=int(length()))
1.129 - fault("UndirPath::nth: index out of range");
1.130 return i=EdgeIt(*this, n);
1.131 }
1.132
1.133 @@ -514,24 +476,18 @@
1.134 template<typename It>
1.135 static
1.136 It& next(It &e) {
1.137 - if( !e.valid() )
1.138 - fault("UndirPath::next() on invalid iterator");
1.139 return ++e;
1.140 }
1.141
1.142 /// \brief Returns node iterator pointing to the head node of the
1.143 /// given edge iterator.
1.144 NodeIt head(const EdgeIt& e) const {
1.145 - if( !e.valid() )
1.146 - fault("UndirPath::head() on invalid iterator");
1.147 return NodeIt(*this, e.idx+1);
1.148 }
1.149
1.150 /// \brief Returns node iterator pointing to the tail node of the
1.151 /// given edge iterator.
1.152 NodeIt tail(const EdgeIt& e) const {
1.153 - if( !e.valid() )
1.154 - fault("UndirPath::tail() on invalid iterator");
1.155 return NodeIt(*this, e.idx);
1.156 }
1.157
1.158 @@ -676,9 +632,6 @@
1.159 ///Push a new edge to the front of the path.
1.160 ///\sa setStartNode
1.161 void pushFront(const GraphEdge& e) {
1.162 - if( !empty() && P.gr->head(e)!=tail() ) {
1.163 - fault("UndirPath::Builder::pushFront: nonincident edge");
1.164 - }
1.165 front.push_back(e);
1.166 }
1.167