26 #ifndef __DATASET_HPP__ 27 #define __DATASET_HPP__ 44 Dataset(
const matrixd& x,
const vectord& y);
47 void setSamples(
const matrixd &x,
const vectord &y);
48 void setSamples(
const matrixd &x);
49 void setSamples(
const vectord &y);
50 void addSample(
const vectord &x,
double y);
51 double getSampleY(
size_t index)
const;
52 vectord getSampleX(
size_t index)
const;
53 double getLastSampleY()
const;
54 vectord getLastSampleX()
const;
56 void plotData(TLogLevel level);
58 vectord getPointAtMinimum()
const;
59 double getValueAtMinimum()
const;
60 size_t getNSamples()
const;
61 void updateMinMax(
size_t i );
67 size_t mMinIndex, mMaxIndex;
73 inline void Dataset::addSample(
const vectord &x,
double y)
75 mX.push_back(x); utils::append(
mY,y);
76 updateMinMax(
mY.size()-1);
79 inline double Dataset::getSampleY(
size_t index)
const 82 inline vectord Dataset::getSampleX(
size_t index)
const 85 inline double Dataset::getLastSampleY()
const 86 {
return mY(
mY.size()-1); }
88 inline vectord Dataset::getLastSampleX()
const 89 {
return mX[
mX.size()-1]; }
92 inline vectord Dataset::getPointAtMinimum()
const {
return mX[mMinIndex]; };
93 inline double Dataset::getValueAtMinimum()
const {
return mY(mMinIndex); };
94 inline size_t Dataset::getNSamples()
const {
return mY.size(); };
95 inline void Dataset::updateMinMax(
size_t i )
97 if (
mY(mMinIndex) >
mY(i) ) mMinIndex = i;
98 else if (
mY(mMaxIndex) <
mY(i) ) mMaxIndex = i;
Boost vector and matrix types.
Namespace of the library interface.
Dataset model to deal with the vector (real) based datasets.
Modules and helper macros for logging.