Library of Assembled Shared Sources
|
connects the data nodes with linear segments. More...
#include <spline_linear.h>
Public Member Functions | |
template<typename PairInputIterator> | |
SplineLinear (PairInputIterator iFirst, PairInputIterator iLast) | |
construct a spline from a range of control/data pairs. | |
template<typename ScalarInputIterator, typename DataInputIterator> | |
SplineLinear (ScalarInputIterator iFirstControl, ScalarInputIterator iLastControl, DataInputIterator iFirstData) | |
construct a spline from seperate ranges. | |
const TData | operator() (TScalar iX) const override |
Get the linear interpolated data value that corresponds with constrol value iX. | |
const TData | derivative (TScalar iX) const override |
Get the first derivative of data value that corresponds with constrol value iX. | |
const TData | integral (TScalar iA, TScalar iB) const override |
Get the integrated data value between control points iA and iB. | |
bool | isEmpty () const override |
return true if the spline contains any nodes at all. | |
const TControlRange | controlRange () const override |
return the range of control values for which the spline can interpolate. | |
connects the data nodes with linear segments.
Definition at line 67 of file spline_linear.h.
lass::num::SplineLinear< S, D, T >::SplineLinear | ( | PairInputIterator | iFirst, |
PairInputIterator | iLast ) |
construct a spline from a range of control/data pairs.
Each node consists of a control value and a data value. This contstructor accepts a single range [iFirst, iLast) of control/data pairs. The iterator type should have two fields first
and second
that contain respectively the control and data values. This is choosen so that a std::pair can be used as a representatin of the control/data pair.
PairInputIterator
has a member first
containing the control value PairInputIterator
has a member second
containing the data valueDefinition at line 86 of file spline_linear.inl.
lass::num::SplineLinear< S, D, T >::SplineLinear | ( | ScalarInputIterator | iFirstControl, |
ScalarInputIterator | iLastControl, | ||
DataInputIterator | iFirstData ) |
construct a spline from seperate ranges.
Each node consists of a control value and a data value. This contstructor accepts seperate ranges for control and data values. The control values are given by the range [iFirstControl , iLastControl). Of the range of the data values, only the iterator iFirstData to the the first element is given.
Definition at line 121 of file spline_linear.inl.
|
overridevirtual |
Get the linear interpolated data value that corresponds with constrol value iX.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 149 of file spline_linear.inl.
References isEmpty().
|
overridevirtual |
Get the first derivative of data value that corresponds with constrol value iX.
As long as iX is exact on a node, it equals to lim_{dx->0} (*this(iX + dx) - *this(iX)) / dx. With linear splines, in theory the first derivative does not exist on the nodes. This function however will return the first derivative on the right of the node. *
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 179 of file spline_linear.inl.
References isEmpty().
|
overridevirtual |
Get the integrated data value between control points iA and iB.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 227 of file spline_linear.inl.
References isEmpty(), and lass::num::sqr().
|
overridevirtual |
return true if the spline contains any nodes at all.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 283 of file spline_linear.inl.
Referenced by derivative(), integral(), and operator()().
|
overridevirtual |
return the range of control values for which the spline can interpolate.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 296 of file spline_linear.inl.