Changeset 886 for trunk/yat/statistics


Ignore:
Timestamp:
Sep 24, 2007, 9:01:06 PM (14 years ago)
Author:
Peter
Message:

add function for Averager and AveragerPair? taking iterators refs #246

Location:
trunk/yat/statistics
Files:
2 edited

Legend:

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

    r865 r886  
    191191  };
    192192 
     193
     194  /**
     195     \brief adding a ranges of values to Averager \a a
     196   */
     197  template <class Iter>
     198  void add(Averager& a, Iter first, Iter last)
     199  {
     200    for ( ; first != last; ++first)
     201      a.add(*first);
     202  }
     203
     204
    193205  // Template implementations
    194206  template <typename T>
  • trunk/yat/statistics/AveragerPair.h

    r865 r886  
    169169  };
    170170
     171  /**
     172     \brief adding a ranges of values to AveragerPair \a ap
     173   */
     174  template <class Iter1, class Iter2>
     175  void add(AveragerPair& ap, Iter1 first1, Iter1 last1, Iter2 first2)
     176  {
     177    for ( ; first1 != last1; ++first1, ++first2)
     178      ap.add(*first1, *first2);
     179  }
     180
     181
    171182  // Template implementations
    172183  template <typename T1, typename T2>
Note: See TracChangeset for help on using the changeset viewer.