lemon/circulation.h
changeset 492 9605e051942f
parent 440 88ed40ad0d4f
child 559 c5fd2d996909
child 610 dacc2cee2b4c
     1.1 --- a/lemon/circulation.h	Thu Jan 01 00:00:00 2009 +0100
     1.2 +++ b/lemon/circulation.h	Mon Feb 23 12:10:26 2009 +0100
     1.3 @@ -31,30 +31,30 @@
     1.4    /// \brief Default traits class of Circulation class.
     1.5    ///
     1.6    /// Default traits class of Circulation class.
     1.7 -  /// \tparam _Diraph Digraph type.
     1.8 -  /// \tparam _LCapMap Lower bound capacity map type.
     1.9 -  /// \tparam _UCapMap Upper bound capacity map type.
    1.10 -  /// \tparam _DeltaMap Delta map type.
    1.11 -  template <typename _Diraph, typename _LCapMap,
    1.12 -            typename _UCapMap, typename _DeltaMap>
    1.13 +  /// \tparam GR Digraph type.
    1.14 +  /// \tparam LM Lower bound capacity map type.
    1.15 +  /// \tparam UM Upper bound capacity map type.
    1.16 +  /// \tparam DM Delta map type.
    1.17 +  template <typename GR, typename LM,
    1.18 +            typename UM, typename DM>
    1.19    struct CirculationDefaultTraits {
    1.20  
    1.21      /// \brief The type of the digraph the algorithm runs on.
    1.22 -    typedef _Diraph Digraph;
    1.23 +    typedef GR Digraph;
    1.24  
    1.25      /// \brief The type of the map that stores the circulation lower
    1.26      /// bound.
    1.27      ///
    1.28      /// The type of the map that stores the circulation lower bound.
    1.29      /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    1.30 -    typedef _LCapMap LCapMap;
    1.31 +    typedef LM LCapMap;
    1.32  
    1.33      /// \brief The type of the map that stores the circulation upper
    1.34      /// bound.
    1.35      ///
    1.36      /// The type of the map that stores the circulation upper bound.
    1.37      /// It must meet the \ref concepts::ReadMap "ReadMap" concept.
    1.38 -    typedef _UCapMap UCapMap;
    1.39 +    typedef UM UCapMap;
    1.40  
    1.41      /// \brief The type of the map that stores the lower bound for
    1.42      /// the supply of the nodes.
    1.43 @@ -62,7 +62,7 @@
    1.44      /// The type of the map that stores the lower bound for the supply
    1.45      /// of the nodes. It must meet the \ref concepts::ReadMap "ReadMap"
    1.46      /// concept.
    1.47 -    typedef _DeltaMap DeltaMap;
    1.48 +    typedef DM DeltaMap;
    1.49  
    1.50      /// \brief The type of the flow values.
    1.51      typedef typename DeltaMap::Value Value;
    1.52 @@ -137,35 +137,33 @@
    1.53       \ref min_cost_flow "minimum cost flow" problem can be calculated
    1.54       in this way.
    1.55  
    1.56 -     \tparam _Digraph The type of the digraph the algorithm runs on.
    1.57 -     \tparam _LCapMap The type of the lower bound capacity map. The default
    1.58 -     map type is \ref concepts::Digraph::ArcMap "_Digraph::ArcMap<int>".
    1.59 -     \tparam _UCapMap The type of the upper bound capacity map. The default
    1.60 -     map type is \c _LCapMap.
    1.61 -     \tparam _DeltaMap The type of the map that stores the lower bound
    1.62 +     \tparam GR The type of the digraph the algorithm runs on.
    1.63 +     \tparam LM The type of the lower bound capacity map. The default
    1.64 +     map type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
    1.65 +     \tparam UM The type of the upper bound capacity map. The default
    1.66 +     map type is \c LM.
    1.67 +     \tparam DM The type of the map that stores the lower bound
    1.68       for the supply of the nodes. The default map type is
    1.69 -     \c _Digraph::ArcMap<_UCapMap::Value>.
    1.70 +     \ref concepts::Digraph::NodeMap "GR::NodeMap<UM::Value>".
    1.71    */
    1.72  #ifdef DOXYGEN
    1.73 -template< typename _Digraph,
    1.74 -          typename _LCapMap,
    1.75 -          typename _UCapMap,
    1.76 -          typename _DeltaMap,
    1.77 -          typename _Traits >
    1.78 +template< typename GR,
    1.79 +          typename LM,
    1.80 +          typename UM,
    1.81 +          typename DM,
    1.82 +          typename TR >
    1.83  #else
    1.84 -template< typename _Digraph,
    1.85 -          typename _LCapMap = typename _Digraph::template ArcMap<int>,
    1.86 -          typename _UCapMap = _LCapMap,
    1.87 -          typename _DeltaMap = typename _Digraph::
    1.88 -                               template NodeMap<typename _UCapMap::Value>,
    1.89 -          typename _Traits=CirculationDefaultTraits<_Digraph, _LCapMap,
    1.90 -                                                    _UCapMap, _DeltaMap> >
    1.91 +template< typename GR,
    1.92 +          typename LM = typename GR::template ArcMap<int>,
    1.93 +          typename UM = LM,
    1.94 +          typename DM = typename GR::template NodeMap<typename UM::Value>,
    1.95 +          typename TR = CirculationDefaultTraits<GR, LM, UM, DM> >
    1.96  #endif
    1.97    class Circulation {
    1.98    public:
    1.99  
   1.100      ///The \ref CirculationDefaultTraits "traits class" of the algorithm.
   1.101 -    typedef _Traits Traits;
   1.102 +    typedef TR Traits;
   1.103      ///The type of the digraph the algorithm runs on.
   1.104      typedef typename Traits::Digraph Digraph;
   1.105      ///The type of the flow values.