COIN-OR::LEMON - Graph Library

Changeset 834:1dd3167db044 in lemon-0.x


Ignore:
Timestamp:
09/13/04 12:50:30 (20 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1132
Message:

There is no runtime debug in path.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/path.h

    r831 r834  
    2929
    3030#include <hugo/invalid.h>
    31 #include <hugo/error.h>
    32 //#include <hugo/debug.h>
    3331
    3432namespace hugo {
     
    7573    /// \warning It is an error if the two edges are not in order!
    7674    DirPath(const DirPath &P, const NodeIt &a, const NodeIt &b) {
    77       if(!a.valid() || !b.valid) {
    78         // FIXME: this check should be more elaborate...
    79         fault("DirPath, subpath ctor: invalid bounding nodes");
    80       }
    8175      gr = P.gr;
    8276      edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
     
    8882    /// \warning It is an error if the two edges are not in order!
    8983    DirPath(const DirPath &P, const EdgeIt &a, const EdgeIt &b) {
    90       if (!a.valid() || !b.valid) {
    91         // FIXME: this check should be more elaborate...
    92         fault("DirPath, subpath ctor: invalid bounding nodes");
    93       }
    9484      gr = P.gr;
    9585      edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
     
    128118    /// \brief Initializes node iterator to point to the node of a given index.
    129119    NodeIt& nth(NodeIt &i, int n) const {
    130       if(n<0 || n>int(length()))
    131         fault("DirPath::nth: index out of range");
    132120      return i=NodeIt(*this, n);
    133121    }
     
    135123    /// \brief Initializes edge iterator to point to the edge of a given index.
    136124    EdgeIt& nth(EdgeIt &i, int n) const {
    137       if(n<0 || n>=int(length()))
    138         fault("DirPath::nth: index out of range");
    139125      return i=EdgeIt(*this, n);
    140126    }
     
    149135    static
    150136    It& next(It &e) {
    151       if( !e.valid() )
    152         fault("DirPath::next() on invalid iterator");
    153137      return ++e;
    154138    }
     
    157141    /// given edge iterator.
    158142    NodeIt head(const EdgeIt& e) const {
    159       if( !e.valid() )
    160         fault("DirPath::head() on invalid iterator");
    161143      return NodeIt(*this, e.idx+1);
    162144    }
     
    165147    /// given edge iterator.
    166148    NodeIt tail(const EdgeIt& e) const {
    167       if( !e.valid() )
    168         fault("DirPath::tail() on invalid iterator");
    169149      return NodeIt(*this, e.idx);
    170150    }
     
    313293      ///\sa setStartNode
    314294      void pushFront(const GraphEdge& e) {
    315         if( !empty() && P.gr->head(e)!=tail() ) {
    316           fault("DirPath::Builder::pushFront: nonincident edge");
    317         }
    318295        front.push_back(e);
    319296      }
     
    324301      ///\sa setStartNode
    325302      void pushBack(const GraphEdge& e) {
    326         if( !empty() && P.gr->tail(e)!=head() ) {
    327           fault("DirPath::Builder::pushBack: nonincident edge");
    328         }
    329303        back.push_back(e);
    330304      }
     
    441415    /// \warning It is an error if the two edges are not in order!
    442416    UndirPath(const UndirPath &P, const NodeIt &a, const NodeIt &b) {
    443       if(!a.valid() || !b.valid) {
    444         // FIXME: this check should be more elaborate...
    445         fault("UndirPath, subpath ctor: invalid bounding nodes");
    446       }
    447417      gr = P.gr;
    448418      edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
     
    454424    /// \warning It is an error if the two edges are not in order!
    455425    UndirPath(const UndirPath &P, const EdgeIt &a, const EdgeIt &b) {
    456       if(!a.valid() || !b.valid) {
    457         // FIXME: this check should be more elaborate...
    458         fault("UndirPath, subpath ctor: invalid bounding nodes");
    459       }
    460426      gr = P.gr;
    461427      edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx);
     
    494460    /// \brief Initializes node iterator to point to the node of a given index.
    495461    NodeIt& nth(NodeIt &i, int n) const {
    496       if(n<0 || n>int(length()))
    497         fault("UndirPath::nth: index out of range");
    498462      return i=NodeIt(*this, n);
    499463    }
     
    501465    /// \brief Initializes edge iterator to point to the edge of a given index.
    502466    EdgeIt& nth(EdgeIt &i, int n) const {
    503       if(n<0 || n>=int(length()))
    504         fault("UndirPath::nth: index out of range");
    505467      return i=EdgeIt(*this, n);
    506468    }
     
    515477    static
    516478    It& next(It &e) {
    517       if( !e.valid() )
    518         fault("UndirPath::next() on invalid iterator");
    519479      return ++e;
    520480    }
     
    523483    /// given edge iterator.
    524484    NodeIt head(const EdgeIt& e) const {
    525       if( !e.valid() )
    526         fault("UndirPath::head() on invalid iterator");
    527485      return NodeIt(*this, e.idx+1);
    528486    }
     
    531489    /// given edge iterator.
    532490    NodeIt tail(const EdgeIt& e) const {
    533       if( !e.valid() )
    534         fault("UndirPath::tail() on invalid iterator");
    535491      return NodeIt(*this, e.idx);
    536492    }
     
    677633      ///\sa setStartNode
    678634      void pushFront(const GraphEdge& e) {
    679         if( !empty() && P.gr->head(e)!=tail() ) {
    680           fault("UndirPath::Builder::pushFront: nonincident edge");
    681         }
    682635        front.push_back(e);
    683636      }
Note: See TracChangeset for help on using the changeset viewer.