yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
TestHelpers.h
Go to the documentation of this file.
1#ifndef TEST_HELPERS_H
2#define TEST_HELPERS_H
3
4#include <vector>
5#include <fstream>
6
7namespace TestHelpers {
8
10 void skip_lines(std::istream& pStream, size_t pLines)
11 {
12 std::string s;
13 for (; pLines; --pLines)
14 std::getline(pStream, s);
15 }
16
18 struct TestData {
20 std::ifstream infile("normalDistr.data");
21
22 data.reserve(1000);
23
24 skip_lines(infile, 5);
25
26 infile >> meanVal;
27 infile >> stdDevVal;
28 infile >> varVal;
29 infile >> RMSVal;
30 infile >> stdErrVal;
31
32 double buffer = 0;
33
34 while(infile >> buffer)
35 data.push_back(buffer);
36 }
37
38 double meanVal;
39 double stdDevVal;
40 double stdErrVal;
41 double RMSVal;
42 double varVal;
43
44 std::vector<double> data;
45 };
46}
47
48#endif
void skip_lines(std::istream &pStream, size_t pLines)
From here: https://stackoverflow.com/a/2581839.
Definition TestHelpers.h:10
Precalculated data with it's properties used in statistical objects tests.
Definition TestHelpers.h:18
std::vector< double > data
Definition TestHelpers.h:44