library of assembled shared sources |
http://lass.cocamware.com |
#include <spline_cubic.h>
Data Structures | |
struct | Node |
Public Types | |
typedef DataTraits | TDataTraits |
typedef Spline< ScalarType, DataType > | TSplineBase |
typedef TSplineBase::TScalar | TScalar |
typedef TSplineBase::TData | TData |
typedef TSplineBase::ControlRange | TControlRange |
Public Member Functions | |
SplineCubic () | |
construct an empty spline | |
template<typename PairInputIterator > | |
SplineCubic (PairInputIterator iFirst, PairInputIterator iLast) | |
construct a spline from a range of control/data pairs. | |
template<typename ScalarInputIterator , typename DataInputIterator > | |
SplineCubic (ScalarInputIterator iFirstControl, ScalarInputIterator iLastControl, DataInputIterator iFirstData) | |
construct a spline from seperate ranges. | |
const TData | operator() (TScalar iX) const |
Get the linear interpolated data value that corresponds with constrol value iX. | |
const TData | derivative (TScalar iX) const |
Get the first derivative of data value that corresponds with constrol value iX. | |
const TData | derivative2 (TScalar iX) const |
Get the second derivative of data value that corresponds with constrol value iX. | |
const TData | integral (TScalar iA, TScalar iB) const |
Get the integrated data value between control points iA and iB. | |
const bool | isEmpty () const |
return true if the spline contains any nodes at all. | |
const TControlRange | controlRange () const |
return the range of control values for which the spline can interpolate. | |
virtual const TData | operator() (TScalar iX) const =0 |
virtual const TData | derivative (TScalar iX) const =0 |
virtual const TData | derivative2 (TScalar iX) const =0 |
virtual const TData | integral (TScalar iA, TScalar iB) const =0 |
Private Types | |
typedef std::vector< Node > | TNodes |
typedef TNodes::const_iterator | TNodeConstIterator |
Private Member Functions | |
void | init () |
const TNodeConstIterator | findNode (TScalar iX) const |
binary search to find node that belongs to iX | |
Private Attributes | |
TNodes | nodes_ |
size_t | dataDimension_ |
Definition at line 67 of file spline_cubic.h.
typedef DataTraits lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TDataTraits |
Definition at line 71 of file spline_cubic.h.
typedef Spline<ScalarType, DataType> lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TSplineBase |
Definition at line 72 of file spline_cubic.h.
typedef TSplineBase::TScalar lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TScalar |
Reimplemented from lass::num::Spline< ScalarType, DataType >.
Definition at line 73 of file spline_cubic.h.
typedef TSplineBase::TData lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TData |
Reimplemented from lass::num::Spline< ScalarType, DataType >.
Definition at line 74 of file spline_cubic.h.
typedef TSplineBase::ControlRange lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TControlRange |
Definition at line 75 of file spline_cubic.h.
typedef std::vector<Node> lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TNodes [private] |
Definition at line 103 of file spline_cubic.h.
typedef TNodes::const_iterator lass::num::SplineCubic< ScalarType, DataType, DataTraits >::TNodeConstIterator [private] |
Definition at line 104 of file spline_cubic.h.
lass::num::SplineCubic< S, D, T >::SplineCubic | ( | ) | [inline] |
lass::num::SplineCubic< S, D, T >::SplineCubic | ( | PairInputIterator | iFirst, | |
PairInputIterator | iLast | |||
) | [inline] |
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 89 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::d, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::init(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_, and lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::x.
lass::num::SplineCubic< S, D, T >::SplineCubic | ( | ScalarInputIterator | iFirstControl, | |
ScalarInputIterator | iLastControl, | |||
DataInputIterator | iFirstData | |||
) | [inline] |
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 123 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::d, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::init(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_, and lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::x.
const SplineCubic< S, D, T >::TData lass::num::SplineCubic< S, D, T >::operator() | ( | TScalar | iX | ) | const [inline] |
Get the linear interpolated data value that corresponds with constrol value iX.
Definition at line 151 of file spline_cubic.inl.
References lass::num::cubic(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::findNode(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::isEmpty(), LASS_ASSERT, and lass::num::sqr().
const SplineCubic< S, D, T >::TData lass::num::SplineCubic< S, D, T >::derivative | ( | TScalar | iX | ) | const [inline] |
Get the first derivative of data value that corresponds with constrol value iX.
Definition at line 178 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::findNode(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::isEmpty(), LASS_ASSERT, and lass::num::sqr().
const SplineCubic< S, D, T >::TData lass::num::SplineCubic< S, D, T >::derivative2 | ( | TScalar | iX | ) | const [inline] |
Get the second derivative of data value that corresponds with constrol value iX.
Definition at line 204 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::findNode(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::isEmpty(), and LASS_ASSERT.
const SplineCubic< S, D, T >::TData lass::num::SplineCubic< S, D, T >::integral | ( | TScalar | iBegin, | |
TScalar | iEnd | |||
) | const [inline] |
Get the integrated data value between control points iA and iB.
Definition at line 230 of file spline_cubic.inl.
References lass::num::cubic(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::findNode(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::isEmpty(), LASS_ASSERT, lass::stde::next(), lass::num::sqr(), and std::swap().
const bool lass::num::SplineCubic< S, D, T >::isEmpty | ( | ) | const [inline, virtual] |
return true if the spline contains any nodes at all.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 297 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_.
Referenced by lass::num::SplineCubic< ScalarType, DataType, DataTraits >::derivative(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::derivative2(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::integral(), and lass::num::SplineCubic< ScalarType, DataType, DataTraits >::operator()().
const SplineCubic< S, D, T >::TControlRange lass::num::SplineCubic< S, D, T >::controlRange | ( | ) | const [inline, virtual] |
return the range of control values for which the spline can interpolate.
Implements lass::num::Spline< ScalarType, DataType >.
Definition at line 310 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_.
void lass::num::SplineCubic< S, D, T >::init | ( | ) | [inline, private] |
Definition at line 320 of file spline_cubic.inl.
References lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::a, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::b, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::c, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::Node::d, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::dataDimension_, lass::num::inv(), LASS_THROW, lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_, and lass::num::sqr().
Referenced by lass::num::SplineCubic< ScalarType, DataType, DataTraits >::SplineCubic().
const SplineCubic< S, D, T >::TNodeConstIterator lass::num::SplineCubic< S, D, T >::findNode | ( | TScalar | iX | ) | const [inline, private] |
binary search to find node that belongs to iX
nodes_
[i].x, nodes_
[i+1].x) nodes_
[0].x nodes_.size()-2
if iX is greater than nodes_
[nodes_.size()-1].xDefinition at line 447 of file spline_cubic.inl.
References lass::prim::distance(), LASS_ASSERT, lass::stde::next(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_, and lass::stde::prev().
Referenced by lass::num::SplineCubic< ScalarType, DataType, DataTraits >::derivative(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::derivative2(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::integral(), and lass::num::SplineCubic< ScalarType, DataType, DataTraits >::operator()().
virtual const TData lass::num::Spline< ScalarType, DataType >::operator() | ( | TScalar | iX | ) | const [pure virtual, inherited] |
virtual const TData lass::num::Spline< ScalarType, DataType >::derivative | ( | TScalar | iX | ) | const [pure virtual, inherited] |
virtual const TData lass::num::Spline< ScalarType, DataType >::derivative2 | ( | TScalar | iX | ) | const [pure virtual, inherited] |
virtual const TData lass::num::Spline< ScalarType, DataType >::integral | ( | TScalar | iA, | |
TScalar | iB | |||
) | const [pure virtual, inherited] |
TNodes lass::num::SplineCubic< ScalarType, DataType, DataTraits >::nodes_ [private] |
Definition at line 109 of file spline_cubic.h.
Referenced by lass::num::SplineCubic< ScalarType, DataType, DataTraits >::controlRange(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::findNode(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::init(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::isEmpty(), and lass::num::SplineCubic< ScalarType, DataType, DataTraits >::SplineCubic().
size_t lass::num::SplineCubic< ScalarType, DataType, DataTraits >::dataDimension_ [private] |
Definition at line 110 of file spline_cubic.h.
Referenced by lass::num::SplineCubic< ScalarType, DataType, DataTraits >::init().
Generated on Mon Nov 10 14:22:10 2008 for Library of Assembled Shared Sources by 1.5.7.1 |