Ignore:
Timestamp:
Feb 18, 2006, 3:46:46 PM (16 years ago)
Author:
Peter
Message:

added percentile function for gslapi::vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/statistics_test.cc

    r502 r511  
    22
    33#include <c++_tools/statistics/utility.h>
     4#include <c++_tools/gslapi/vector.h>
    45
    56#include <vector>
     
    89
    910
    10 using namespace std;
    11 
    1211int main()
    1312
     13  using namespace theplu;
     14  gslapi::vector gsl_vec(10);
    1415  std::vector<double> data;
    15   for (unsigned int i=0; i<10; i++)
     16  for (unsigned int i=0; i<10; i++){
    1617    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)
    1923    return -1;
    2024  return 0;
Note: See TracChangeset for help on using the changeset viewer.