Last change
on this file since 511 was
511,
checked in by Peter, 17 years ago
|
added percentile function for gslapi::vector
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
471 bytes
|
Line | |
---|
1 | // $Id: statistics_test.cc 511 2006-02-18 14:46:46Z peter $ |
---|
2 | |
---|
3 | #include <c++_tools/statistics/utility.h> |
---|
4 | #include <c++_tools/gslapi/vector.h> |
---|
5 | |
---|
6 | #include <vector> |
---|
7 | #include <cstdlib> |
---|
8 | #include <iostream> |
---|
9 | |
---|
10 | |
---|
11 | int main() |
---|
12 | { |
---|
13 | using namespace theplu; |
---|
14 | gslapi::vector gsl_vec(10); |
---|
15 | std::vector<double> data; |
---|
16 | for (unsigned int i=0; i<10; i++){ |
---|
17 | data.push_back(static_cast<double>(i)); |
---|
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) |
---|
23 | return -1; |
---|
24 | return 0; |
---|
25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.