[Lemon-commits] [lemon_svn] hegyi: r1132 - hugo/trunk/src/hugo

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:43:26 CET 2006


Author: hegyi
Date: Mon Sep 13 12:50:30 2004
New Revision: 1132

Modified:
   hugo/trunk/src/hugo/path.h

Log:
There is no runtime debug in path.h

Modified: hugo/trunk/src/hugo/path.h
==============================================================================
--- hugo/trunk/src/hugo/path.h	(original)
+++ hugo/trunk/src/hugo/path.h	Mon Sep 13 12:50:30 2004
@@ -28,8 +28,6 @@
 #include <algorithm>
 
 #include <hugo/invalid.h>
-#include <hugo/error.h>
-//#include <hugo/debug.h>
 
 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<typename It>
     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<typename It>
     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);
       }
 



More information about the Lemon-commits mailing list