Ignore:
Timestamp:
Sep 29, 2007, 4:18:52 AM (14 years ago)
Author:
Peter
Message:

refactoring add function in Averagers, refs #246

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/AveragerWeighted.h

    r910 r914  
    226226  void add(AveragerWeighted& a, Iter first, Iter last)
    227227  {
    228     add(a, first, last,
    229         typename utility::weighted_iterator_traits<Iter>::type());
     228    for ( ; first != last; ++first)
     229      a.add(utility::iterator_traits_data(first));
    230230  }
    231 
    232 
    233   // unweighted impl.
    234   template <typename Iter>
    235   void add(AveragerWeighted& a, Iter first, Iter last,
    236            utility::unweighted_type type)
    237   {
    238     for ( ; first != last; ++first)
    239       a.add(*first);
    240   }
    241 
    242   // weighted impl.
    243   template <typename Iter>
    244   void add(AveragerWeighted& a, Iter first, Iter last,
    245            utility::weighted_type type)
    246   {
    247     for ( ; first != last; ++first)
    248       a.add(first.data(), first.weight());
    249   }
    250 
    251231
    252232  // Template implementations
Note: See TracChangeset for help on using the changeset viewer.