BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCDataSet.h
1 #ifndef __BCDATASET__H
2 #define __BCDATASET__H
3 
16 /*
17  * Copyright (C) 2007-2014, the BAT core developer team
18  * All rights reserved.
19  *
20  * For the licensing terms see doc/COPYING.
21  * For documentation see http://mpp.mpg.de/bat
22  */
23 
24 // ---------------------------------------------------------
25 
26 #include <vector>
27 
28 // BAT classes
29 class BCDataPoint;
30 
31 // ---------------------------------------------------------
32 
33 typedef std::vector<BCDataPoint*> BCDataVector;
34 
35 // ---------------------------------------------------------
36 
37 class BCDataSet
38 {
39  public:
40 
46  BCDataSet();
47 
50  BCDataSet(const BCDataSet & bcdataset);
51 
54  virtual ~BCDataSet();
55 
62  BCDataSet & operator = (const BCDataSet & bcdataset);
63 
70  unsigned int GetNDataPoints();
71 
74  unsigned int GetNValuesPerPoint();
75 
79  BCDataPoint * GetDataPoint(unsigned int index);
80 
86  std::vector<double> GetDataComponents(int index);
87 
96  int ReadDataFromFile(const char * filename, const char * treename, const char * branchnames)
97  { return this -> ReadDataFromFileTree(filename, treename, branchnames); };
98 
99  int ReadDataFromFile(const char * filename, int nvariables)
100  { return this -> ReadDataFromFileTxt(filename, nvariables); };
101 
114  int ReadDataFromFileTree(const char * filename, const char * treename, const char * branchnames);
115 
124  int ReadDataFromFileTxt(const char * filename, int nvariables);
125 
129  void AddDataPoint(BCDataPoint * datapoint);
130 
133  void Reset();
134 
137  void Dump();
138 
141  private:
142  // todo why a pointer? creates a huge amount of unnecessary checks
145  BCDataVector * fBCDataVector;
146 
147 };
148 
149 // ---------------------------------------------------------
150 
151 #endif
152 
A class representing a data point.
Definition: BCDataPoint.h:31
unsigned int GetNValuesPerPoint()
Definition: BCDataSet.cxx:86
int ReadDataFromFile(const char *filename, const char *treename, const char *branchnames)
Definition: BCDataSet.h:96
A class representing a set of data points.
Definition: BCDataSet.h:37
BCDataSet & operator=(const BCDataSet &bcdataset)
Definition: BCDataSet.cxx:59
int ReadDataFromFileTree(const char *filename, const char *treename, const char *branchnames)
Definition: BCDataSet.cxx:135
void Reset()
Definition: BCDataSet.cxx:373
std::vector< double > GetDataComponents(int index)
Definition: BCDataSet.cxx:116
virtual ~BCDataSet()
Definition: BCDataSet.cxx:31
int ReadDataFromFileTxt(const char *filename, int nvariables)
Definition: BCDataSet.cxx:277
void Dump()
Definition: BCDataSet.cxx:385
BCDataPoint * GetDataPoint(unsigned int index)
Definition: BCDataSet.cxx:98
unsigned int GetNDataPoints()
Definition: BCDataSet.cxx:79
void AddDataPoint(BCDataPoint *datapoint)
Definition: BCDataSet.cxx:358