# Changeset 1043 for trunk/yat/statistics

Ignore:
Timestamp:
Feb 6, 2008, 8:30:03 PM (16 years ago)
Message:

fixing #128 - iterators in Averger classes

Location:
trunk/yat/statistics
Files:
4 edited

Unmodified
Removed
• ## trunk/yat/statistics/AveragerPair.h

 r1000 void add(const double x, const double y, const unsigned long n=1); /// /// Adding pairs of arrays with data points \a x and \a y. /// /// The requirements for the types T1 and T2 of the arrays \a x /// and \a y are: operator[] returning an element and function /// size() returning the number of elements. /// template void add_values(const T1& x, const T2& y); /// /// \f$\frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sum_i /// (x_i-m_x)^2+\sum_i (y_i-m_y)^2 + n(m_x-m_y)^2} \f$ /// /// In case of a zero denominator - zero is returned. /// /// @return Concordence correlation coefficient. /// /** \f$\frac{\sum_i (x_i-m_x)(y_i-m_y)}{\sum_i (x_i-m_x)^2+\sum_i (y_i-m_y)^2 + n(m_x-m_y)^2} \f$ In case of a zero denominator - zero is returned. @return Concordence correlation coefficient. */ double ccc(void) const; /** \brief adding a ranges of values to AveragerPair \a ap \brief adding data from two ranges to AveragerPair \a ap */ template // Template implementations template void AveragerPair::add_values(const T1& x, const T2& y) { for (size_t i=0; i
• ## trunk/yat/statistics/AveragerPairWeighted.cc

 r1000 wxy_ += w*x*y; w_ +=w; } void AveragerPairWeighted::add(const classifier::DataLookup1D& x, const classifier::DataLookupWeighted1D& y) { assert(x.size()==y.size()); for (size_t i=0; i
• ## trunk/yat/statistics/AveragerPairWeighted.h

 r1009 void  add(const double x, const double y, const double wx, const double wy); /// /// Adding two sequences of data @a x and @a y. The data /// should be paired so \f$x(i) \f$ is associated to \f$y(i) \f$ /// @a x will be treated as having all weights equal to unity /// void add(const classifier::DataLookup1D& x, const classifier::DataLookupWeighted1D& y); /// /// Adding two sequences of data @a x and @a y. The data should be /// paired so \f$x(i) \f$ is associated to \f$y(i) \f$ /// @a y will be treated as having all weights equal to unity /// void add(const classifier::DataLookupWeighted1D& x, const classifier::DataLookup1D& y); /// /// Adding two sequences of weighted data @a x and @a y. The data /// should be paired so \f$x(i) \f$ is associated to \f$y(i) \f$ /// void add(const classifier::DataLookupWeighted1D& x, const classifier::DataLookupWeighted1D& y); /// /// Adding pair of data and corresponding pair of weights in arrays /// /// /// The requirements for the types T1, T2, T3 and T4 of the arrays /// are: operator[] returning an element and function /// size() /// returning the number of elements. /// template void add_values(const T1& x, const T2& y, const T3& wx, const T4& wy); /// template void  AveragerPairWeighted::add_values(const T1& x, const T2& y, const T3& wx, const T4& wy) /** \brief adding four ranges of values to AveragerPairWeighted \a ap */ template void add(AveragerPairWeighted& ap, Iter1 x, Iter1 xlast, Iter2 y, Iter3 wx, Iter4 wy) { for (size_t i=0; i(!std::isnan(x(i))); add(x[i],y[i],wx[i],wy[i]); utility::check_iterator_is_unweighted(x); utility::check_iterator_is_unweighted(y); utility::check_iterator_is_unweighted(wx); utility::check_iterator_is_unweighted(wy); while (x!=xlast) { ap.add(*x, *y, *wx, *wy); ++x; ++y; ++wx; ++wy; } } }}} // of namespace statistics, yat, and theplu
• ## trunk/yat/statistics/AveragerWeighted.h

 r1000 /** \brief adding a range of values to AveragerWeighted \a a If iterator is non-weighted unitary weights are used. */ template
Note: See TracChangeset for help on using the changeset viewer.