1 #ifndef CTL_INTERVALDATASERIES_H 2 #define CTL_INTERVALDATASERIES_H 4 #include "pointseriesbase.h" 68 enum ValueType { BinIntegral,
80 ValueType samples = BinIntegral);
83 ValueType samples = BinIntegral);
90 using PointSeriesBase::normalizeByMaxAbsVal;
91 using PointSeriesBase::normalizeByMaxVal;
93 void setValue(
uint sampleNb,
float value);
101 float integral(
const std::vector<float>& weights)
const;
108 float _firstBinStart;
109 ValueType _valueType;
115 #endif // CTL_INTERVALDATASERIES_H
void setValues(const std::vector< float > &values)
Sets the values passed by values as bin values for this series.
Definition: intervaldataseries.cpp:276
IntervalDataSeries(float binWidth, float firstBinStart=0.0f, ValueType valueType=BinIntegral)
Constructs an empty IntervalDataSeries object for a series with bin width binWidth.
Definition: intervaldataseries.cpp:30
static IntervalDataSeries sampledFromModel(const AbstractIntegrableDataModel &dataModel, float from, float to, uint nbSamples, ValueType samples=BinIntegral)
Return a series of nbSamples values sampled from dataModel within the specified interval [ from,...
Definition: intervaldataseries.cpp:110
ValueType valueType() const
Returns the type of the values in the series, i.e. whether they represent bin integrals or mean value...
Definition: intervaldataseries.cpp:373
The PointSeriesBase class is the base class used to represent a series of data tuples.
Definition: pointseriesbase.h:32
IntervalDataSeries normalizedByIntegral() const
Returns a copy of the series in which the values have been normalized such that the integral will be ...
Definition: intervaldataseries.cpp:250
The IntervalDataSeries class is a container for a series of values sampled in equidistant steps (i....
Definition: intervaldataseries.h:65
void append(float value)
Appends value to the series.
Definition: intervaldataseries.cpp:187
float centroid() const
Returns the centroid of the series.
Definition: intervaldataseries.cpp:335
void clampToRange(const SamplingRange &range)
Clamps all values in this series to the interval specified by range.
Definition: intervaldataseries.cpp:421
unsigned int uint
Qt style alias for unsigned int.
Definition: modulelayout.h:6
SamplingRange samplingRange() const
Returns the range (of x-values) covered by all bins of this series.
Definition: intervaldataseries.cpp:359
float integral() const
Returns the integral over the series.
Definition: intervaldataseries.cpp:198
std::vector< float > values() const
Definition: pointseriesbase.cpp:145
The AbstractIntegrableDataModel class is the base class for data models that provide a means to integ...
Definition: abstractdatamodel.h:110
float value(uint sampleNb) const
Definition: pointseriesbase.cpp:135
uint nbSamples() const
Definition: pointseriesbase.cpp:59
SamplingRange binBounds(uint binNb) const
Returns the boundaries of the interval covered by the bin with index binNb.
Definition: intervaldataseries.cpp:305
float binWidth() const
Returns the bin width (or x distance between two consecutive sampling points).
Definition: intervaldataseries.cpp:314
void normalizeByIntegral()
Normalizes the values in the series such that the integral will be one afterwards.
Definition: intervaldataseries.cpp:232
void scaleValues(float factor)
Definition: pointseriesbase.cpp:251
std::vector< float > samplingPointsForIndices(uint startIdx, uint endIdx) const
Computes the sampling points for bins with indices between startIdx and endIdx.
Definition: intervaldataseries.cpp:383