BCDataPoint Class Reference

A class representing a data point. More...

#include <BCDataPoint.h>

Public Member Functions

Constructors and destructor
 BCDataPoint (int nvariables=0)
 A constructor. More...
 
 BCDataPoint (const std::vector< double > &x)
 A constructor. More...
 
operators
double & operator[] (unsigned index)
 Raw and fast access. More...
 
const double & operator[] (unsigned index) const
 Raw and fast access. More...
 
Member functions (get)
double GetValue (unsigned index) const
 Safer access, but slower. More...
 
std::vector< double > & GetValues ()
 
const std::vector< double > & GetValues () const
 
unsigned int GetNValues () const
 Returns the number of values. More...
 
Member functions (set)
void SetValue (unsigned index, double value)
 Safer, but slower, value setting of a variable. More...
 
void SetValues (const std::vector< double > &values)
 Set the values of all variables. More...
 
void SetNValues (unsigned n, double val=0.)
 Set the number of variables. More...
 
Member functions (miscellaneous methods)
void PrintSummary (void(*output)(const std::string &)=BCLog::OutSummary) const
 Print summary of data point to the string handler. More...
 

Detailed Description

A class representing a data point.

Author
Daniel Kollar
Kevin Kröninger
Version
1.0
Date
08.2008

This class represents a data point which is the basic unit of information. A data point can be an event, a bin content, etc. Each data point can store several variables of type double. The variables are organized in a vector.

Definition at line 34 of file BCDataPoint.h.

Constructor & Destructor Documentation

BCDataPoint::BCDataPoint ( int  nvariables = 0)

A constructor.

Parameters
nvariablesThe number of variables stored in a data object.

Definition at line 18 of file BCDataPoint.cxx.

BCDataPoint::BCDataPoint ( const std::vector< double > &  x)

A constructor.

Parameters
xThe vector containing the data.

Definition at line 24 of file BCDataPoint.cxx.

Member Function Documentation

unsigned int BCDataPoint::GetNValues ( ) const
inline

Returns the number of values.

Definition at line 89 of file BCDataPoint.h.

double BCDataPoint::GetValue ( unsigned  index) const
inline

Safer access, but slower.

Parameters
indexThe index of the variable.
Returns
The value of the variable.

Definition at line 74 of file BCDataPoint.h.

std::vector<double>& BCDataPoint::GetValues ( )
inline
Returns
A vector of values.

Definition at line 79 of file BCDataPoint.h.

const std::vector<double>& BCDataPoint::GetValues ( ) const
inline
Returns
A vector of values.

Definition at line 84 of file BCDataPoint.h.

double& BCDataPoint::operator[] ( unsigned  index)
inline

Raw and fast access.

Definition at line 57 of file BCDataPoint.h.

const double& BCDataPoint::operator[] ( unsigned  index) const
inline

Raw and fast access.

Definition at line 62 of file BCDataPoint.h.

void BCDataPoint::PrintSummary ( void(*)(const std::string &)  output = BCLog::OutSummary) const

Print summary of data point to the string handler.

Parameters
outputString handler (default = BCLog::OutSummary.

Definition at line 44 of file BCDataPoint.cxx.

void BCDataPoint::SetNValues ( unsigned  n,
double  val = 0. 
)
inline

Set the number of variables.

Use with caution!

Parameters
nNew dimensionality to set for data point.
valValue to fill into new data values if enlarging data point size.

Definition at line 114 of file BCDataPoint.h.

void BCDataPoint::SetValue ( unsigned  index,
double  value 
)
inline

Safer, but slower, value setting of a variable.

Parameters
indexThe index of the variable
valueThe value of the variable

Definition at line 101 of file BCDataPoint.h.

void BCDataPoint::SetValues ( const std::vector< double > &  values)

Set the values of all variables.

Parameters
valuesA vector of values

Definition at line 30 of file BCDataPoint.cxx.


The documentation for this class was generated from the following files: