lemon/lgf_reader.h
changeset 1032 62ba43576f85
parent 786 e20173729589
child 950 2d583da4ba40
child 964 2b6bffe0e7e8
equal deleted inserted replaced
42:67843cd1f86e 43:a6b2db1aa9d6
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2009
     5  * Copyright (C) 2003-2010
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   560   private:
   560   private:
   561 
   561 
   562     template <typename TDGR>
   562     template <typename TDGR>
   563     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is);
   563     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, std::istream& is);
   564     template <typename TDGR>
   564     template <typename TDGR>
   565     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, 
   565     friend DigraphReader<TDGR> digraphReader(TDGR& digraph,
   566                                              const std::string& fn);
   566                                              const std::string& fn);
   567     template <typename TDGR>
   567     template <typename TDGR>
   568     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, const char *fn);
   568     friend DigraphReader<TDGR> digraphReader(TDGR& digraph, const char *fn);
   569 
   569 
   570     DigraphReader(DigraphReader& other)
   570     DigraphReader(DigraphReader& other)
  1185     }
  1185     }
  1186 
  1186 
  1187     /// @}
  1187     /// @}
  1188 
  1188 
  1189   };
  1189   };
  1190   
  1190 
  1191   /// \ingroup lemon_io
  1191   /// \ingroup lemon_io
  1192   ///
  1192   ///
  1193   /// \brief Return a \ref DigraphReader class
  1193   /// \brief Return a \ref DigraphReader class
  1194   ///
  1194   ///
  1195   /// This function just returns a \ref DigraphReader class.
  1195   /// This function just returns a \ref DigraphReader class.
  1196   ///
  1196   ///
  1197   /// With this function a digraph can be read from an 
  1197   /// With this function a digraph can be read from an
  1198   /// \ref lgf-format "LGF" file or input stream with several maps and
  1198   /// \ref lgf-format "LGF" file or input stream with several maps and
  1199   /// attributes. For example, there is network flow problem on a
  1199   /// attributes. For example, there is network flow problem on a
  1200   /// digraph, i.e. a digraph with a \e capacity map on the arcs and
  1200   /// digraph, i.e. a digraph with a \e capacity map on the arcs and
  1201   /// \e source and \e target nodes. This digraph can be read with the
  1201   /// \e source and \e target nodes. This digraph can be read with the
  1202   /// following code:
  1202   /// following code:
  1247     return tmp;
  1247     return tmp;
  1248   }
  1248   }
  1249 
  1249 
  1250   template <typename GR>
  1250   template <typename GR>
  1251   class GraphReader;
  1251   class GraphReader;
  1252  
  1252 
  1253   template <typename TGR>
  1253   template <typename TGR>
  1254   GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin);
  1254   GraphReader<TGR> graphReader(TGR& graph, std::istream& is = std::cin);
  1255   template <typename TGR>
  1255   template <typename TGR>
  1256   GraphReader<TGR> graphReader(TGR& graph, const std::string& fn);
  1256   GraphReader<TGR> graphReader(TGR& graph, const std::string& fn);
  1257   template <typename TGR>
  1257   template <typename TGR>
  1384 
  1384 
  1385   private:
  1385   private:
  1386     template <typename TGR>
  1386     template <typename TGR>
  1387     friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is);
  1387     friend GraphReader<TGR> graphReader(TGR& graph, std::istream& is);
  1388     template <typename TGR>
  1388     template <typename TGR>
  1389     friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn); 
  1389     friend GraphReader<TGR> graphReader(TGR& graph, const std::string& fn);
  1390     template <typename TGR>
  1390     template <typename TGR>
  1391     friend GraphReader<TGR> graphReader(TGR& graph, const char *fn);
  1391     friend GraphReader<TGR> graphReader(TGR& graph, const char *fn);
  1392 
  1392 
  1393     GraphReader(GraphReader& other)
  1393     GraphReader(GraphReader& other)
  1394       : _is(other._is), local_is(other.local_is), _graph(other._graph),
  1394       : _is(other._is), local_is(other.local_is), _graph(other._graph),
  2061 
  2061 
  2062   /// \ingroup lemon_io
  2062   /// \ingroup lemon_io
  2063   ///
  2063   ///
  2064   /// \brief Return a \ref GraphReader class
  2064   /// \brief Return a \ref GraphReader class
  2065   ///
  2065   ///
  2066   /// This function just returns a \ref GraphReader class. 
  2066   /// This function just returns a \ref GraphReader class.
  2067   ///
  2067   ///
  2068   /// With this function a graph can be read from an 
  2068   /// With this function a graph can be read from an
  2069   /// \ref lgf-format "LGF" file or input stream with several maps and
  2069   /// \ref lgf-format "LGF" file or input stream with several maps and
  2070   /// attributes. For example, there is weighted matching problem on a
  2070   /// attributes. For example, there is weighted matching problem on a
  2071   /// graph, i.e. a graph with a \e weight map on the edges. This
  2071   /// graph, i.e. a graph with a \e weight map on the edges. This
  2072   /// graph can be read with the following code:
  2072   /// graph can be read with the following code:
  2073   ///
  2073   ///