Ignore:
Timestamp:
Sep 30, 2007, 2:50:10 AM (14 years ago)
Author:
Peter
Message:

Sorry this commit is a bit to big.

Adding a yat_assert. The yat assert are turned on by providing a
'-DYAT_DEBUG' flag to preprocessor if normal cassert is turned
on. This flag is activated for developers running configure with
--enable-debug. The motivation is that we can use these yat_asserts in
header files and the yat_asserts will be invisible to the normal user
also if he uses C-asserts.

added output operator in DataLookup2D and removed output operator in
MatrixLookup?

Removed template function add_values in Averager and weighted version

Added function to AveragerWeighted? taking iterator to four ranges.

File:
1 edited

Legend:

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

    r915 r916  
    8383
    8484    ///
    85     /// Adding each value in an array \a x and corresponding value in
    86     /// weight array \a w.
    87     ///
    88     /// The requirements for the types T1 and T2 of the arrays \a x
    89     /// and \a w are: operator[] returning an element and function
    90     /// size() returning the number of elements.
    91     ///
    92     template <typename T1, typename T2>
    93     void add_values(const T1& x, const T2& w);
    94 
    95     ///
    9685    /// @brief Calculate the weighted mean
    9786    ///
     
    221210
    222211  /**
    223      \brief adding a ranges of values to AveragerWeighted \a a
     212     \brief adding a range of values to AveragerWeighted \a a
    224213   */
    225214  template <typename Iter>
     
    230219  }
    231220
    232   // Template implementations
    233   template <typename T1, typename T2>
    234   void AveragerWeighted::add_values(const T1& x, const T2& w)
     221  /**
     222     \brief add values from two ranges to AveragerWeighted \a a
     223
     224     Add data from range [first1, last1) with their corresponding
     225     weight in range [first2, first2 + distance(first, last) ).
     226
     227     Requirement: Iter1 and Iter2 are unweighted iterators.
     228   */
     229  template <typename Iter1, typename Iter2>
     230  void add(AveragerWeighted& a, Iter1 first1, Iter1 last1, Iter2 first2)
    235231  {
    236     for (size_t i=0; i<x.size(); i++)
    237       add(x[i],w[i]);
     232    utility::check_iterator_is_unweighted(first1);
     233    utility::check_iterator_is_unweighted(first2);
     234    for ( ; first1 != last1; ++first1, ++first2)
     235      a.add(*first1, *first2);
    238236  }
    239237
    240 ///
    241 /// The AveragerWeighted output operator
    242 ///
    243 ///std::ostream& operator<<(std::ostream& s,const AveragerWeighted&);
    244 
    245238}}} // of namespace statistics, yat, and theplu
    246239
Note: See TracChangeset for help on using the changeset viewer.