Changeset 910 for trunk/yat/statistics
 Timestamp:
 Sep 29, 2007, 2:20:10 AM (16 years ago)
 Location:
 trunk/yat/statistics
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/statistics/Averager.h
r887 r910 195 195 \brief adding a ranges of values to Averager \a a 196 196 */ 197 template < class Aver,typename Iter>198 void add(Aver & a, Iter first, Iter last)197 template <typename Iter> 198 void add(Averager& a, Iter first, Iter last) 199 199 { 200 200 for ( ; first != last; ++first) 
trunk/yat/statistics/AveragerWeighted.h
r888 r910 28 28 29 29 #include "Averager.h" 30 #include "yat/utility/IteratorTraits.h" 30 31 31 32 #include <cmath> … … 219 220 }; 220 221 222 /** 223 \brief adding a ranges of values to Averager \a a 224 */ 225 template <typename Iter> 226 void add(AveragerWeighted& a, Iter first, Iter last) 227 { 228 add(a, first, last, 229 typename utility::weighted_iterator_traits<Iter>::type()); 230 } 231 232 233 // unweighted impl. 234 template <typename Iter> 235 void add(AveragerWeighted& a, Iter first, Iter last, 236 utility::unweighted_type type) 237 { 238 for ( ; first != last; ++first) 239 a.add(*first); 240 } 241 242 // weighted impl. 243 template <typename Iter> 244 void add(AveragerWeighted& a, Iter first, Iter last, 245 utility::weighted_type type) 246 { 247 for ( ; first != last; ++first) 248 a.add(first.data(), first.weight()); 249 } 250 251 221 252 // Template implementations 222 253 template <typename T1, typename T2>
Note: See TracChangeset
for help on using the changeset viewer.