src/work/klao/path.h
changeset 804 6874a72dbdc5
parent 686 fc8a3393e0d9
child 806 93246c00cd24
equal deleted inserted replaced
11:4f5027e89a22 12:b154b43a7e2c
   301       
   301       
   302       /// Sets the starting node of the path. Edge added to the path
   302       /// Sets the starting node of the path. Edge added to the path
   303       /// afterwards have to be incident to this node.
   303       /// afterwards have to be incident to this node.
   304       /// It should be called iff the path is empty and before any call to
   304       /// It should be called iff the path is empty and before any call to
   305       /// \ref pushFront() or \ref pushBack()
   305       /// \ref pushFront() or \ref pushBack()
   306       void setStart(const GraphNode &) {}
   306       void setStartNode(const GraphNode &) {}
   307 
   307 
   308       ///Push a new edge to the front of the path
   308       ///Push a new edge to the front of the path
   309 
   309 
   310       ///Push a new edge to the front of the path.
   310       ///Push a new edge to the front of the path.
   311       ///\sa setStart
   311       ///\sa setStartNode
   312       void pushFront(const GraphEdge& e) {
   312       void pushFront(const GraphEdge& e) {
   313 	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
   313 	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
   314 	  fault("DirPath::Builder::pushFront: nonincident edge");
   314 	  fault("DirPath::Builder::pushFront: nonincident edge");
   315 	}
   315 	}
   316 	front.push_back(e);
   316 	front.push_back(e);
   317       }
   317       }
   318 
   318 
   319       ///Push a new edge to the back of the path
   319       ///Push a new edge to the back of the path
   320 
   320 
   321       ///Push a new edge to the back of the path.
   321       ///Push a new edge to the back of the path.
   322       ///\sa setStart
   322       ///\sa setStartNode
   323       void pushBack(const GraphEdge& e) {
   323       void pushBack(const GraphEdge& e) {
   324 	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
   324 	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
   325 	  fault("DirPath::Builder::pushBack: nonincident edge");
   325 	  fault("DirPath::Builder::pushBack: nonincident edge");
   326 	}
   326 	}
   327 	back.push_back(e);
   327 	back.push_back(e);
   342       }
   342       }
   343 
   343 
   344       // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
   344       // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
   345       // Hogy kenyelmes egy ilyet hasznalni?
   345       // Hogy kenyelmes egy ilyet hasznalni?
   346   
   346   
   347       ///Reserve storage in advance for the builder
   347       ///Reserve storage for the builder in advance.
   348 
   348 
   349       ///If you know an reasonable upper bound of the number of the edges
   349       ///If you know an reasonable upper bound of the number of the edges
   350       ///to add, using this function you can speed up the building.
   350       ///to add, using this function you can speed up the building.
   351       void reserve(size_t r) {
   351       void reserve(size_t r) {
   352 	front.reserve(r);
   352 	front.reserve(r);
   662       
   662       
   663       /// Sets the starting node of the path. Edge added to the path
   663       /// Sets the starting node of the path. Edge added to the path
   664       /// afterwards have to be incident to this node.
   664       /// afterwards have to be incident to this node.
   665       /// It should be called iff the path is empty and before any call to
   665       /// It should be called iff the path is empty and before any call to
   666       /// \ref pushFront() or \ref pushBack()
   666       /// \ref pushFront() or \ref pushBack()
   667       void setStart(const GraphNode &) {}
   667       void setStartNode(const GraphNode &) {}
   668 
   668 
   669       ///Push a new edge to the front of the path
   669       ///Push a new edge to the front of the path
   670 
   670 
   671       ///Push a new edge to the front of the path.
   671       ///Push a new edge to the front of the path.
   672       ///\sa setStart
   672       ///\sa setStartNode
   673       void pushFront(const GraphEdge& e) {
   673       void pushFront(const GraphEdge& e) {
   674 	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
   674 	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
   675 	  fault("UndirPath::Builder::pushFront: nonincident edge");
   675 	  fault("UndirPath::Builder::pushFront: nonincident edge");
   676 	}
   676 	}
   677 	front.push_back(e);
   677 	front.push_back(e);
   678       }
   678       }
   679 
   679 
   680       ///Push a new edge to the back of the path
   680       ///Push a new edge to the back of the path
   681 
   681 
   682       ///Push a new edge to the back of the path.
   682       ///Push a new edge to the back of the path.
   683       ///\sa setStart
   683       ///\sa setStartNode
   684       void pushBack(const GraphEdge& e) {
   684       void pushBack(const GraphEdge& e) {
   685 	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
   685 	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
   686 	  fault("UndirPath::Builder::pushBack: nonincident edge");
   686 	  fault("UndirPath::Builder::pushBack: nonincident edge");
   687 	}
   687 	}
   688 	back.push_back(e);
   688 	back.push_back(e);
   703       }
   703       }
   704 
   704 
   705       // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
   705       // FIXME: Hmm, pontosan hogy is kene ezt csinalni?
   706       // Hogy kenyelmes egy ilyet hasznalni?
   706       // Hogy kenyelmes egy ilyet hasznalni?
   707 
   707 
   708       ///Reserve storage in advance for the builder
   708       ///Reserve storage for the builder in advance.
   709 
   709 
   710       ///If you know an reasonable upper bound of the number of the edges
   710       ///If you know an reasonable upper bound of the number of the edges
   711       ///to add, using this function you can speed up the building.
   711       ///to add, using this function you can speed up the building.
   712        void reserve(size_t r) {
   712        void reserve(size_t r) {
   713 	front.reserve(r);
   713 	front.reserve(r);