COIN-OR::LEMON - Graph Library

Changeset 1547:dd57a540ff5f in lemon-0.x


Ignore:
Timestamp:
07/12/05 18:16:19 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2043
Message:

Improve doc

Location:
lemon
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_utils.h

    r1540 r1547  
    194194  /// \brief Copy a map.
    195195  ///
    196   /// Thsi function copies the \c source map to the \c target map. It uses the
     196  /// This function copies the \c source map to the \c target map. It uses the
    197197  /// given iterator to iterate on the data structure and it uses the \c ref
    198198  /// mapping to convert the source's keys to the target's keys.
  • lemon/kruskal.h

    r1449 r1547  
    4646
    4747  /// This function runs Kruskal's algorithm to find a minimum cost tree.
    48   /// \param G The graph the algorithm runs on. The algorithm considers the
     48  /// \param g The graph the algorithm runs on. The algorithm considers the
    4949  /// graph to be undirected, the direction of the edges are not used.
    5050  ///
     
    7777  template <class GR, class IN, class OUT>
    7878  typename IN::value_type::second_type
    79   kruskal(GR const& G, IN const& in,
     79  kruskal(GR const& g, IN const& in,
    8080                 OUT& out)
    8181  {
     
    8484    typedef typename GR::Node Node;
    8585
    86     NodeIntMap comp(G, -1);
     86    NodeIntMap comp(g, -1);
    8787    UnionFind<Node,NodeIntMap> uf(comp);
    8888     
     
    9090    for (typename IN::const_iterator p = in.begin();
    9191         p!=in.end(); ++p ) {
    92       if ( uf.join(G.target((*p).first),
    93                    G.source((*p).first)) ) {
     92      if ( uf.join(g.target((*p).first),
     93                   g.source((*p).first)) ) {
    9494        out.set((*p).first, true);
    9595        tot_cost += (*p).second;
     
    110110  ///
    111111  /// A typical examle is the following call:
    112   /// <tt>kruskal(G, some_input, makeSequenceOutput(iterator))</tt>.
     112  /// <tt>kruskal(g, some_input, makeSequenceOutput(iterator))</tt>.
    113113  /// Here, the third argument is a temporary object (which wraps around an
    114114  /// iterator with a writable bool map interface), and thus by rules of C++
     
    131131  inline
    132132  typename IN::value_type::second_type
    133   kruskal(GR const& G, IN const& edges, OUT const& out_map)
     133  kruskal(GR const& g, IN const& edges, OUT const& out_map)
    134134  {
    135135    NonConstMapWr<OUT> map_wr(out_map);
    136     return kruskal(G, edges, map_wr);
     136    return kruskal(g, edges, map_wr);
    137137  } 
    138138
     
    176176    template<class _GR>
    177177    typename enable_if<typename _GR::UndirTag,void>::type
    178     fillWithEdges(const _GR& G, const Map& m,dummy<0> = 0)
     178    fillWithEdges(const _GR& g, const Map& m,dummy<0> = 0)
    179179    {
    180       for(typename GR::UndirEdgeIt e(G);e!=INVALID;++e)
     180      for(typename GR::UndirEdgeIt e(g);e!=INVALID;++e)
    181181        push_back(value_type(typename GR::Edge(e,true), m[e]));
    182182    }
     
    184184    template<class _GR>
    185185    typename disable_if<typename _GR::UndirTag,void>::type
    186     fillWithEdges(const _GR& G, const Map& m,dummy<1> = 1)
     186    fillWithEdges(const _GR& g, const Map& m,dummy<1> = 1)
    187187    {
    188       for(typename GR::EdgeIt e(G);e!=INVALID;++e)
     188      for(typename GR::EdgeIt e(g);e!=INVALID;++e)
    189189        push_back(value_type(e, m[e]));
    190190    }
     
    197197    }
    198198
    199     KruskalMapInput(GR const& G, Map const& m) {
    200       fillWithEdges(G,m);
     199    KruskalMapInput(GR const& g, Map const& m) {
     200      fillWithEdges(g,m);
    201201      sort();
    202202    }
     
    212212  /// want to use the function kruskalEdgeMap() instead.
    213213  ///
    214   ///\param G The type of the graph the algorithm runs on.
     214  ///\param g The type of the graph the algorithm runs on.
    215215  ///\param m An edge map containing the cost of the edges.
    216216  ///\par
     
    224224  template<class GR, class Map>
    225225  inline
    226   KruskalMapInput<GR,Map> makeKruskalMapInput(const GR &G,const Map &m)
     226  KruskalMapInput<GR,Map> makeKruskalMapInput(const GR &g,const Map &m)
    227227  {
    228     return KruskalMapInput<GR,Map>(G,m);
     228    return KruskalMapInput<GR,Map>(g,m);
    229229  }
    230230 
     
    292292  /// Input is from an edge map, output is a plain bool map.
    293293  ///
    294   ///\param G The type of the graph the algorithm runs on.
     294  ///\param g The type of the graph the algorithm runs on.
    295295  ///\param in An edge map containing the cost of the edges.
    296296  ///\par
     
    311311  inline
    312312  typename IN::Value
    313   kruskalEdgeMap(GR const& G,
     313  kruskalEdgeMap(GR const& g,
    314314                 IN const& in,
    315315                 RET &out) {
    316     return kruskal(G,
    317                    KruskalMapInput<GR,IN>(G,in),
     316    return kruskal(g,
     317                   KruskalMapInput<GR,IN>(g,in),
    318318                   out);
    319319  }
     
    325325  /// Input is from an edge map, output is an STL Sequence.
    326326  ///
    327   ///\param G The type of the graph the algorithm runs on.
     327  ///\param g The type of the graph the algorithm runs on.
    328328  ///\param in An edge map containing the cost of the edges.
    329329  ///\par
     
    336336  /// <tt>GR::Edge</tt> as its <tt>value_type</tt>.
    337337  /// The algorithm copies the elements of the found tree into this sequence.
    338   /// For example, if we know that the spanning tree of the graph \c G has
     338  /// For example, if we know that the spanning tree of the graph \c g has
    339339  /// say 53 edges then
    340340  /// we can put its edges into a STL vector \c tree with a code like this.
    341341  /// \code
    342342  /// std::vector<Edge> tree(53);
    343   /// kruskalEdgeMap_IteratorOut(G,cost,tree.begin());
     343  /// kruskalEdgeMap_IteratorOut(g,cost,tree.begin());
    344344  /// \endcode
    345345  /// Or if we don't know in advance the size of the tree, we can write this.
    346346  /// \code
    347347  /// std::vector<Edge> tree;
    348   /// kruskalEdgeMap_IteratorOut(G,cost,std::back_inserter(tree));
     348  /// kruskalEdgeMap_IteratorOut(g,cost,std::back_inserter(tree));
    349349  /// \endcode
    350350  ///
     
    356356  inline
    357357  typename IN::Value
    358   kruskalEdgeMap_IteratorOut(const GR& G,
     358  kruskalEdgeMap_IteratorOut(const GR& g,
    359359                             const IN& in,
    360360                             RET out)
    361361  {
    362362    KruskalSequenceOutput<RET> _out(out);
    363     return kruskal(G, KruskalMapInput<GR,IN>(G, in), _out);
     363    return kruskal(g, KruskalMapInput<GR,IN>(g, in), _out);
    364364  }
    365365
  • lemon/maps.h

    r1537 r1547  
    222222  };
    223223
    224   ///Convert the \c Value of a maps to another type.
     224  ///Convert the \c Value of a map to another type.
    225225
    226226  ///This \ref concept::ReadMap "read only map"
    227227  ///converts the \c Value of a maps to type \c T.
    228   ///Its \c Value is inherited from \c M.
    229   ///
    230   ///\bug wrong documentation
     228  ///Its \c Key is inherited from \c M.
    231229  template<class M, class T>
    232230  class ConvertMap {
     
    305303  }
    306304
    307   ///Shift a maps with a constant.
     305  ///Shift a map with a constant.
    308306
    309307  ///This \ref concept::ReadMap "read only map" returns the sum of the
     
    315313  ///  ShiftMap<X> sh(x,v);
    316314  ///\endcode
    317   ///it is equivalent with
     315  ///is equivalent with
    318316  ///\code
    319317  ///  ConstMap<X::Key, X::Value> c_tmp(v);
     
    356354
    357355  ///This \ref concept::ReadMap "read only map" returns the difference
    358   ///of the values returned by the two
     356  ///of the values of the two
    359357  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    360358  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
     
    392390
    393391  ///This \ref concept::ReadMap "read only map" returns the product of the
    394   ///values returned by the two
     392  ///values of the two
    395393  ///given
    396394  ///maps. Its \c Key and \c Value will be inherited from \c M1.
     
    425423  }
    426424 
    427   ///Scale a maps with a constant.
     425  ///Scales a maps with a constant.
    428426
    429427  ///This \ref concept::ReadMap "read only map" returns the value of the
    430   ///given map multipied with a constant value.
     428  ///given map multiplied with a constant value.
    431429  ///Its \c Key and \c Value is inherited from \c M.
    432430  ///
     
    435433  ///  ScaleMap<X> sc(x,v);
    436434  ///\endcode
    437   ///it is equivalent with
     435  ///is equivalent with
    438436  ///\code
    439437  ///  ConstMap<X::Key, X::Value> c_tmp(v);
     
    476474
    477475  ///This \ref concept::ReadMap "read only map" returns the quotient of the
    478   ///values returned by the two
     476  ///values of the two
    479477  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    480478  ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
     
    553551  }
    554552 
    555   ///Combine of two maps using an STL (binary) functor.
    556 
    557   ///Combine of two maps using an STL (binary) functor.
    558   ///
    559   ///
    560   ///This \ref concept::ReadMap "read only map" takes to maps and a
     553  ///Combines of two maps using an STL (binary) functor.
     554
     555  ///Combines of two maps using an STL (binary) functor.
     556  ///
     557  ///
     558  ///This \ref concept::ReadMap "read only map" takes two maps and a
    561559  ///binary functor and returns the composition of
    562   ///two
     560  ///the two
    563561  ///given maps unsing the functor.
    564562  ///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2
     
    790788
    791789
    792   ///Apply all map setting operations to two maps
     790  ///Applies all map setting operations to two maps
    793791
    794792  ///This map has two \ref concept::WriteMap "writable map"
Note: See TracChangeset for help on using the changeset viewer.