Changeset 511 for trunk/test/statistics_test.cc
 Timestamp:
 Feb 18, 2006, 3:46:46 PM (17 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/statistics_test.cc
r502 r511 2 2 3 3 #include <c++_tools/statistics/utility.h> 4 #include <c++_tools/gslapi/vector.h> 4 5 5 6 #include <vector> … … 8 9 9 10 10 using namespace std;11 12 11 int main() 13 12 { 13 using namespace theplu; 14 gslapi::vector gsl_vec(10); 14 15 std::vector<double> data; 15 for (unsigned int i=0; i<10; i++) 16 for (unsigned int i=0; i<10; i++){ 16 17 data.push_back(static_cast<double>(i)); 17 double m=theplu::statistics::median(data); 18 if (m!=4.5) 18 gsl_vec(i)=i; 19 } 20 double m=statistics::median(data); 21 double m_gsl=statistics::median(gsl_vec); 22 if (m!=4.5  m!=m_gsl) 19 23 return 1; 20 24 return 0;
Note: See TracChangeset
for help on using the changeset viewer.