1 #ifndef __BCDATAPOINT__H 2 #define __BCDATAPOINT__H 58 {
return fData[index]; }
63 {
return fData[index]; }
75 {
return fData.at(index); }
90 {
return fData.size(); };
102 { fData.at(index) = value; }
107 void SetValues(
const std::vector<double>& values);
115 { fData.resize(n, val); }
125 void PrintSummary(
void (*output)(
const std::string&) = BCLog::OutSummary)
const;
133 std::vector<double> fData;
A class representing a data point.
void SetNValues(unsigned n, double val=0.)
Set the number of variables.
unsigned int GetNValues() const
Returns the number of values.
void PrintSummary(void(*output)(const std::string &)=BCLog::OutSummary) const
Print summary of data point to the string handler.
void SetValues(const std::vector< double > &values)
Set the values of all variables.
const std::vector< double > & GetValues() const
double GetValue(unsigned index) const
Safer access, but slower.
double & operator[](unsigned index)
Raw and fast access.
const double & operator[](unsigned index) const
Raw and fast access.
void SetValue(unsigned index, double value)
Safer, but slower, value setting of a variable.
std::vector< double > & GetValues()
BCDataPoint(int nvariables=0)
A constructor.