Ignore:
Timestamp:
May 15, 2008, 12:25:54 AM (13 years ago)
Author:
Peter
Message:

Adding a functor that calculate average of a range. Also added a metafunction that return Averager or AveragerWeighted? depending on context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/statistics_test.cc

    r1275 r1305  
    6262  if (!(std::abs(kurtosis_gsl+1.5616363636363637113)<1e-10) )
    6363    suite.add(false);
    64   return 0;
     64  statistics::Average func;
     65  suite.add(suite.equal(func(gsl_vec.begin(), gsl_vec.end()),4.5));
     66  // easiest way to get a weighted iterator
     67  classifier::MatrixLookupWeighted mlw(10,20,2.0, 1.0);
     68  suite.add(suite.equal(func(mlw.begin(), mlw.end()),2.0));
     69 
     70
     71  return suite.return_value();
    6572}
Note: See TracChangeset for help on using the changeset viewer.