lemon/concept/bpugraph.h
changeset 2111 ea1fa1bc3f6d
parent 1993 2115143eceea
child 2120 a907fb95f1e0
equal deleted inserted replaced
5:be6dd4c6230e 6:b203b3bee130
   945 	}
   945 	}
   946       };
   946       };
   947 
   947 
   948     };
   948     };
   949 
   949 
   950     /// \brief An empty non-static undirected graph class.
       
   951     ///    
       
   952     /// This class provides everything that \ref BpUGraph does.
       
   953     /// Additionally it enables building graphs from scratch.
       
   954     class ExtendableBpUGraph : public BpUGraph {
       
   955     public:
       
   956       
       
   957       /// \brief Add a new ANode to the graph.
       
   958       ///
       
   959       /// Add a new ANode to the graph.
       
   960       /// \return the new node.
       
   961       Node addANode();
       
   962 
       
   963       /// \brief Add a new ANode to the graph.
       
   964       ///
       
   965       /// Add a new ANode to the graph.
       
   966       /// \return the new node.
       
   967       Node addBNode();
       
   968 
       
   969       /// \brief Add a new undirected edge to the graph.
       
   970       ///
       
   971       /// Add a new undirected edge to the graph. One of the nodes
       
   972       /// should be ANode and the other should be BNode.
       
   973       /// \pre The nodes are not in the same nodeset.
       
   974       /// \return the new edge.
       
   975       UEdge addEdge(const Node& from, const Node& to);
       
   976 
       
   977       /// \brief Resets the graph.
       
   978       ///
       
   979       /// This function deletes all undirected edges and nodes of the graph.
       
   980       /// It also frees the memory allocated to store them.
       
   981       void clear() { }
       
   982 
       
   983       template <typename Graph>
       
   984       struct Constraints {
       
   985 	void constraints() {}
       
   986       };
       
   987 
       
   988     };
       
   989 
       
   990     /// \brief An empty erasable undirected graph class.
       
   991     ///
       
   992     /// This class is an extension of \ref ExtendableBpUGraph. It makes it
       
   993     /// possible to erase undirected edges or nodes.
       
   994     class ErasableBpUGraph : public ExtendableBpUGraph {
       
   995     public:
       
   996 
       
   997       /// \brief Deletes a node.
       
   998       ///
       
   999       /// Deletes a node.
       
  1000       ///
       
  1001       void erase(Node) { }
       
  1002       /// \brief Deletes an undirected edge.
       
  1003       ///
       
  1004       /// Deletes an undirected edge.
       
  1005       ///
       
  1006       void erase(UEdge) { }
       
  1007 
       
  1008       template <typename Graph>
       
  1009       struct Constraints {
       
  1010 	void constraints() {}
       
  1011       };
       
  1012 
       
  1013     };
       
  1014 
   950 
  1015     /// @}
   951     /// @}
  1016 
   952 
  1017   }
   953   }
  1018 
   954