equal
deleted
inserted
replaced
23 #include <string> |
23 #include <string> |
24 #include <vector> |
24 #include <vector> |
25 #include <limits> |
25 #include <limits> |
26 #include <lemon/maps.h> |
26 #include <lemon/maps.h> |
27 #include <lemon/error.h> |
27 #include <lemon/error.h> |
|
28 |
28 /// \ingroup dimacs_group |
29 /// \ingroup dimacs_group |
29 /// \file |
30 /// \file |
30 /// \brief DIMACS file format reader. |
31 /// \brief DIMACS file format reader. |
31 |
32 |
32 namespace lemon { |
33 namespace lemon { |
116 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
117 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
117 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
118 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
118 /// a non-zero value, that value will be used as "infinite". |
119 /// a non-zero value, that value will be used as "infinite". |
119 /// |
120 /// |
120 /// If the file type was previously evaluated by dimacsType(), then |
121 /// If the file type was previously evaluated by dimacsType(), then |
121 /// the descriptor struct should be given by the \c dest parameter. |
122 /// the descriptor struct should be given by the \c desc parameter. |
122 template <typename Digraph, typename LowerMap, |
123 template <typename Digraph, typename LowerMap, |
123 typename CapacityMap, typename CostMap, |
124 typename CapacityMap, typename CostMap, |
124 typename SupplyMap> |
125 typename SupplyMap> |
125 void readDimacsMin(std::istream& is, |
126 void readDimacsMin(std::istream& is, |
126 Digraph &g, |
127 Digraph &g, |
270 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
271 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
271 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
272 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
272 /// a non-zero value, that value will be used as "infinite". |
273 /// a non-zero value, that value will be used as "infinite". |
273 /// |
274 /// |
274 /// If the file type was previously evaluated by dimacsType(), then |
275 /// If the file type was previously evaluated by dimacsType(), then |
275 /// the descriptor struct should be given by the \c dest parameter. |
276 /// the descriptor struct should be given by the \c desc parameter. |
276 template<typename Digraph, typename CapacityMap> |
277 template<typename Digraph, typename CapacityMap> |
277 void readDimacsMax(std::istream& is, |
278 void readDimacsMax(std::istream& is, |
278 Digraph &g, |
279 Digraph &g, |
279 CapacityMap& capacity, |
280 CapacityMap& capacity, |
280 typename Digraph::Node &s, |
281 typename Digraph::Node &s, |
297 /// At the beginning, \c g is cleared by \c g.clear(). The arc |
298 /// At the beginning, \c g is cleared by \c g.clear(). The arc |
298 /// lengths are written to the \c length arc map and \c s is set to the |
299 /// lengths are written to the \c length arc map and \c s is set to the |
299 /// source node. |
300 /// source node. |
300 /// |
301 /// |
301 /// If the file type was previously evaluated by dimacsType(), then |
302 /// If the file type was previously evaluated by dimacsType(), then |
302 /// the descriptor struct should be given by the \c dest parameter. |
303 /// the descriptor struct should be given by the \c desc parameter. |
303 template<typename Digraph, typename LengthMap> |
304 template<typename Digraph, typename LengthMap> |
304 void readDimacsSp(std::istream& is, |
305 void readDimacsSp(std::istream& is, |
305 Digraph &g, |
306 Digraph &g, |
306 LengthMap& length, |
307 LengthMap& length, |
307 typename Digraph::Node &s, |
308 typename Digraph::Node &s, |
328 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
329 /// \c std::numeric_limits<Capacity>::infinity() will be used if available, |
329 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
330 /// \c std::numeric_limits<Capacity>::max() otherwise. If \c infty is set to |
330 /// a non-zero value, that value will be used as "infinite". |
331 /// a non-zero value, that value will be used as "infinite". |
331 /// |
332 /// |
332 /// If the file type was previously evaluated by dimacsType(), then |
333 /// If the file type was previously evaluated by dimacsType(), then |
333 /// the descriptor struct should be given by the \c dest parameter. |
334 /// the descriptor struct should be given by the \c desc parameter. |
334 template<typename Digraph, typename CapacityMap> |
335 template<typename Digraph, typename CapacityMap> |
335 void readDimacsCap(std::istream& is, |
336 void readDimacsCap(std::istream& is, |
336 Digraph &g, |
337 Digraph &g, |
337 CapacityMap& capacity, |
338 CapacityMap& capacity, |
338 typename CapacityMap::Value infty = 0, |
339 typename CapacityMap::Value infty = 0, |
368 /// p mat |
369 /// p mat |
369 /// \endcode |
370 /// \endcode |
370 /// At the beginning, \c g is cleared by \c g.clear(). |
371 /// At the beginning, \c g is cleared by \c g.clear(). |
371 /// |
372 /// |
372 /// If the file type was previously evaluated by dimacsType(), then |
373 /// If the file type was previously evaluated by dimacsType(), then |
373 /// the descriptor struct should be given by the \c dest parameter. |
374 /// the descriptor struct should be given by the \c desc parameter. |
374 template<typename Graph> |
375 template<typename Graph> |
375 void readDimacsMat(std::istream& is, Graph &g, |
376 void readDimacsMat(std::istream& is, Graph &g, |
376 DimacsDescriptor desc=DimacsDescriptor()) |
377 DimacsDescriptor desc=DimacsDescriptor()) |
377 { |
378 { |
378 if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is); |
379 if(desc.type==DimacsDescriptor::NONE) desc=dimacsType(is); |