923 Node target(Arc a) const { return Node(arcs[a._id].target); } |
923 Node target(Arc a) const { return Node(arcs[a._id].target); } |
924 |
924 |
925 Node redNode(Edge e) const { return Node(arcs[2 * e._id].target); } |
925 Node redNode(Edge e) const { return Node(arcs[2 * e._id].target); } |
926 Node blueNode(Edge e) const { return Node(arcs[2 * e._id + 1].target); } |
926 Node blueNode(Edge e) const { return Node(arcs[2 * e._id + 1].target); } |
927 |
927 |
928 Node u(Edge e) const { return redNode(e); } |
|
929 Node v(Edge e) const { return blueNode(e); } |
|
930 |
|
931 static bool direction(Arc a) { |
928 static bool direction(Arc a) { |
932 return (a._id & 1) == 1; |
929 return (a._id & 1) == 1; |
933 } |
930 } |
934 |
931 |
935 static Arc direct(Edge e, bool d) { |
932 static Arc direct(Edge e, bool d) { |
1099 |
1096 |
1100 typedef BpGraphExtender<SmartBpGraphBase> ExtendedSmartBpGraphBase; |
1097 typedef BpGraphExtender<SmartBpGraphBase> ExtendedSmartBpGraphBase; |
1101 |
1098 |
1102 /// \ingroup graphs |
1099 /// \ingroup graphs |
1103 /// |
1100 /// |
1104 /// \brief A smart undirected graph class. |
1101 /// \brief A smart undirected bipartite graph class. |
1105 /// |
1102 /// |
1106 /// \ref SmartBpGraph is a simple and fast graph implementation. |
1103 /// \ref SmartBpGraph is a simple and fast bipartite graph implementation. |
1107 /// It is also quite memory efficient but at the price |
1104 /// It is also quite memory efficient but at the price |
1108 /// that it does not support node and edge deletion |
1105 /// that it does not support node and edge deletion |
1109 /// (except for the Snapshot feature). |
1106 /// (except for the Snapshot feature). |
1110 /// |
1107 /// |
1111 /// This type fully conforms to the \ref concepts::Graph "Graph concept" |
1108 /// This type fully conforms to the \ref concepts::BpGraph "BpGraph concept" |
1112 /// and it also provides some additional functionalities. |
1109 /// and it also provides some additional functionalities. |
1113 /// Most of its member functions and nested classes are documented |
1110 /// Most of its member functions and nested classes are documented |
1114 /// only in the concept class. |
1111 /// only in the concept class. |
1115 /// |
1112 /// |
1116 /// This class provides constant time counting for nodes, edges and arcs. |
1113 /// This class provides constant time counting for nodes, edges and arcs. |
1117 /// |
1114 /// |
1118 /// \sa concepts::Graph |
1115 /// \sa concepts::BpGraph |
1119 /// \sa SmartDigraph |
1116 /// \sa SmartGraph |
1120 class SmartBpGraph : public ExtendedSmartBpGraphBase { |
1117 class SmartBpGraph : public ExtendedSmartBpGraphBase { |
1121 typedef ExtendedSmartBpGraphBase Parent; |
1118 typedef ExtendedSmartBpGraphBase Parent; |
1122 |
1119 |
1123 private: |
1120 private: |
1124 /// Graphs are \e not copy constructible. Use GraphCopy instead. |
1121 /// Graphs are \e not copy constructible. Use GraphCopy instead. |