Changeset 1043 for trunk/yat/statistics/AveragerPairWeighted.h
 Timestamp:
 Feb 6, 2008, 8:30:03 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/statistics/AveragerPairWeighted.h
r1009 r1043 73 73 void add(const double x, const double y, 74 74 const double wx, const double wy); 75 76 ///77 /// Adding two sequences of data @a x and @a y. The data78 /// should be paired so \f$ x(i) \f$ is associated to \f$ y(i) \f$79 /// @a x will be treated as having all weights equal to unity80 ///81 void add(const classifier::DataLookup1D& x,82 const classifier::DataLookupWeighted1D& y);83 84 ///85 /// Adding two sequences of data @a x and @a y. The data should be86 /// paired so \f$ x(i) \f$ is associated to \f$ y(i) \f$87 /// @a y will be treated as having all weights equal to unity88 ///89 void add(const classifier::DataLookupWeighted1D& x,90 const classifier::DataLookup1D& y);91 92 ///93 /// Adding two sequences of weighted data @a x and @a y. The data94 /// should be paired so \f$ x(i) \f$ is associated to \f$ y(i) \f$95 ///96 void add(const classifier::DataLookupWeighted1D& x,97 const classifier::DataLookupWeighted1D& y);98 99 ///100 /// Adding pair of data and corresponding pair of weights in arrays101 ///102 ///103 /// The requirements for the types T1, T2, T3 and T4 of the arrays104 /// are: operator[] returning an element and function /// size()105 /// returning the number of elements.106 ///107 template <typename T1,typename T2,typename T3,typename T4>108 void add_values(const T1& x,109 const T2& y,110 const T3& wx,111 const T4& wy);112 75 113 76 /// … … 194 157 195 158 196 template <typename T1,typename T2,typename T3,typename T4> 197 void AveragerPairWeighted::add_values(const T1& x, 198 const T2& y, 199 const T3& wx, 200 const T4& wy) 159 /** 160 \brief adding four ranges of values to AveragerPairWeighted \a ap 161 */ 162 template <class Iter1, class Iter2, class Iter3, class Iter4> 163 void add(AveragerPairWeighted& ap, Iter1 x, Iter1 xlast, Iter2 y, Iter3 wx, 164 Iter4 wy) 201 165 { 202 for (size_t i=0; i<x.size(); ++i){ 203 utility::yat_assert<std::runtime_error>(!std::isnan(x(i))); 204 add(x[i],y[i],wx[i],wy[i]); 166 utility::check_iterator_is_unweighted(x); 167 utility::check_iterator_is_unweighted(y); 168 utility::check_iterator_is_unweighted(wx); 169 utility::check_iterator_is_unweighted(wy); 170 while (x!=xlast) { 171 ap.add(*x, *y, *wx, *wy); 172 ++x; 173 ++y; 174 ++wx; 175 ++wy; 205 176 } 206 177 } 178 207 179 208 180 }}} // of namespace statistics, yat, and theplu
Note: See TracChangeset
for help on using the changeset viewer.