source: trunk/test/statistics_test.cc @ 502

Last change on this file since 502 was 502, checked in by Peter, 17 years ago

improved median and percentile functions

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 335 bytes
Line 
1// $Id: statistics_test.cc 502 2006-01-30 22:05:20Z peter $
2
3#include <c++_tools/statistics/utility.h>
4
5#include <vector>
6#include <cstdlib>
7#include <iostream>
8
9
10using namespace std;
11
12int main()
13{ 
14  std::vector<double> data;
15  for (unsigned int i=0; i<10; i++)
16    data.push_back(static_cast<double>(i));
17  double m=theplu::statistics::median(data);
18  if (m!=4.5)
19    return -1;
20  return 0;
21}
Note: See TracBrowser for help on using the repository browser.