Ignore:
Timestamp:
Feb 25, 2008, 9:23:47 PM (14 years ago)
Author:
Peter
Message:

fixes #292

File:
1 edited

Legend:

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

    r1000 r1145  
    2929
    3030#include "AveragerWeighted.h"
     31#include "yat/utility/iterator_traits.h"
    3132
    3233#include <string>
     
    191192  };
    192193
     194  /**
     195     Add a range [first, last) of values to Histogram.
     196   */
     197  template<typename ForwardIterator>
     198  void add(Histogram& h,
     199           ForwardIterator first, ForwardIterator last)
     200  {
     201    while (first!=last) {
     202      h.add(utility::iterator_traits<ForwardIterator>().data(),
     203            utility::iterator_traits<ForwardIterator>().weight());
     204      ++first;
     205    }
     206  }
     207
    193208///
    194209/// The Histogram output operator
Note: See TracChangeset for help on using the changeset viewer.