Changeset 834:1dd3167db044 in lemon0.x
 Timestamp:
 09/13/04 12:50:30 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1132
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/hugo/path.h
r831 r834 29 29 30 30 #include <hugo/invalid.h> 31 #include <hugo/error.h>32 //#include <hugo/debug.h>33 31 34 32 namespace hugo { … … 75 73 /// \warning It is an error if the two edges are not in order! 76 74 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 }81 75 gr = P.gr; 82 76 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); … … 88 82 /// \warning It is an error if the two edges are not in order! 89 83 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 }94 84 gr = P.gr; 95 85 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); … … 128 118 /// \brief Initializes node iterator to point to the node of a given index. 129 119 NodeIt& nth(NodeIt &i, int n) const { 130 if(n<0  n>int(length()))131 fault("DirPath::nth: index out of range");132 120 return i=NodeIt(*this, n); 133 121 } … … 135 123 /// \brief Initializes edge iterator to point to the edge of a given index. 136 124 EdgeIt& nth(EdgeIt &i, int n) const { 137 if(n<0  n>=int(length()))138 fault("DirPath::nth: index out of range");139 125 return i=EdgeIt(*this, n); 140 126 } … … 149 135 static 150 136 It& next(It &e) { 151 if( !e.valid() )152 fault("DirPath::next() on invalid iterator");153 137 return ++e; 154 138 } … … 157 141 /// given edge iterator. 158 142 NodeIt head(const EdgeIt& e) const { 159 if( !e.valid() )160 fault("DirPath::head() on invalid iterator");161 143 return NodeIt(*this, e.idx+1); 162 144 } … … 165 147 /// given edge iterator. 166 148 NodeIt tail(const EdgeIt& e) const { 167 if( !e.valid() )168 fault("DirPath::tail() on invalid iterator");169 149 return NodeIt(*this, e.idx); 170 150 } … … 313 293 ///\sa setStartNode 314 294 void pushFront(const GraphEdge& e) { 315 if( !empty() && P.gr>head(e)!=tail() ) {316 fault("DirPath::Builder::pushFront: nonincident edge");317 }318 295 front.push_back(e); 319 296 } … … 324 301 ///\sa setStartNode 325 302 void pushBack(const GraphEdge& e) { 326 if( !empty() && P.gr>tail(e)!=head() ) {327 fault("DirPath::Builder::pushBack: nonincident edge");328 }329 303 back.push_back(e); 330 304 } … … 441 415 /// \warning It is an error if the two edges are not in order! 442 416 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 }447 417 gr = P.gr; 448 418 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); … … 454 424 /// \warning It is an error if the two edges are not in order! 455 425 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 }460 426 gr = P.gr; 461 427 edges.insert(edges.end(), P.edges.begin()+a.idx, P.edges.begin()+b.idx); … … 494 460 /// \brief Initializes node iterator to point to the node of a given index. 495 461 NodeIt& nth(NodeIt &i, int n) const { 496 if(n<0  n>int(length()))497 fault("UndirPath::nth: index out of range");498 462 return i=NodeIt(*this, n); 499 463 } … … 501 465 /// \brief Initializes edge iterator to point to the edge of a given index. 502 466 EdgeIt& nth(EdgeIt &i, int n) const { 503 if(n<0  n>=int(length()))504 fault("UndirPath::nth: index out of range");505 467 return i=EdgeIt(*this, n); 506 468 } … … 515 477 static 516 478 It& next(It &e) { 517 if( !e.valid() )518 fault("UndirPath::next() on invalid iterator");519 479 return ++e; 520 480 } … … 523 483 /// given edge iterator. 524 484 NodeIt head(const EdgeIt& e) const { 525 if( !e.valid() )526 fault("UndirPath::head() on invalid iterator");527 485 return NodeIt(*this, e.idx+1); 528 486 } … … 531 489 /// given edge iterator. 532 490 NodeIt tail(const EdgeIt& e) const { 533 if( !e.valid() )534 fault("UndirPath::tail() on invalid iterator");535 491 return NodeIt(*this, e.idx); 536 492 } … … 677 633 ///\sa setStartNode 678 634 void pushFront(const GraphEdge& e) { 679 if( !empty() && P.gr>head(e)!=tail() ) {680 fault("UndirPath::Builder::pushFront: nonincident edge");681 }682 635 front.push_back(e); 683 636 }
Note: See TracChangeset
for help on using the changeset viewer.