equal
deleted
inserted
replaced
75 "source 1\n" |
75 "source 1\n" |
76 "target 12\n"; |
76 "target 12\n"; |
77 |
77 |
78 |
78 |
79 // Check the interface of an MCF algorithm |
79 // Check the interface of an MCF algorithm |
80 template <typename GR, typename Value> |
80 template <typename GR, typename Flow, typename Cost> |
81 class McfClassConcept |
81 class McfClassConcept |
82 { |
82 { |
83 public: |
83 public: |
84 |
84 |
85 template <typename MCF> |
85 template <typename MCF> |
114 ignore_unused_variable_warning(x); |
114 ignore_unused_variable_warning(x); |
115 } |
115 } |
116 |
116 |
117 typedef typename GR::Node Node; |
117 typedef typename GR::Node Node; |
118 typedef typename GR::Arc Arc; |
118 typedef typename GR::Arc Arc; |
119 typedef concepts::ReadMap<Node, Value> NM; |
119 typedef concepts::ReadMap<Node, Flow> NM; |
120 typedef concepts::ReadMap<Arc, Value> AM; |
120 typedef concepts::ReadMap<Arc, Flow> FAM; |
|
121 typedef concepts::ReadMap<Arc, Cost> CAM; |
121 |
122 |
122 const GR &g; |
123 const GR &g; |
123 const AM &lower; |
124 const FAM &lower; |
124 const AM &upper; |
125 const FAM &upper; |
125 const AM &cost; |
126 const CAM &cost; |
126 const NM ⊃ |
127 const NM ⊃ |
127 const Node &n; |
128 const Node &n; |
128 const Arc &a; |
129 const Arc &a; |
129 const Value &k; |
130 const Flow &k; |
130 Value v; |
131 Flow v; |
131 bool b; |
132 bool b; |
132 |
133 |
133 typename MCF::FlowMap &flow; |
134 typename MCF::FlowMap &flow; |
134 typename MCF::PotentialMap &pot; |
135 typename MCF::PotentialMap &pot; |
135 }; |
136 }; |
204 |
205 |
205 int main() |
206 int main() |
206 { |
207 { |
207 // Check the interfaces |
208 // Check the interfaces |
208 { |
209 { |
209 typedef int Value; |
210 typedef int Flow; |
|
211 typedef int Cost; |
210 // TODO: This typedef should be enabled if the standard maps are |
212 // TODO: This typedef should be enabled if the standard maps are |
211 // reference maps in the graph concepts (See #190). |
213 // reference maps in the graph concepts (See #190). |
212 /**/ |
214 /**/ |
213 //typedef concepts::Digraph GR; |
215 //typedef concepts::Digraph GR; |
214 typedef ListDigraph GR; |
216 typedef ListDigraph GR; |
215 /**/ |
217 /**/ |
216 checkConcept< McfClassConcept<GR, Value>, |
218 checkConcept< McfClassConcept<GR, Flow, Cost>, |
217 NetworkSimplex<GR, Value> >(); |
219 NetworkSimplex<GR, Flow, Cost> >(); |
218 } |
220 } |
219 |
221 |
220 // Run various MCF tests |
222 // Run various MCF tests |
221 typedef ListDigraph Digraph; |
223 typedef ListDigraph Digraph; |
222 DIGRAPH_TYPEDEFS(ListDigraph); |
224 DIGRAPH_TYPEDEFS(ListDigraph); |