SSpline< T > Class Template Reference

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

template<typename T>
class SSpline< T >

Approximating cubic spline

Compute an approximating cubic spline to the points {x,y}. The boundary conditions are fixed to zero second derivative. The x values must be strictly monotonically increasing. The degree of smoothing is controlled by the parameter mu, with 0 <= mu <= 1. mu = 0 implies no smoothing (the spline is interpolating), mu = 1 implies maximal smoothing (the spline approaches a linear fit to the data).


Member Typedef Documentation

template<typename T >
typedef T SSpline< T >::value_type

Member Enumeration Documentation

template<typename T >
anonymous enum
Enumerator:
isVectorizable 

Constructor & Destructor Documentation

template<typename T >
SSpline< T >::SSpline ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y,
const MArray< T, 1 > &  sigma,
const T  mu 
) [inline]

Construct an approximating spline to the data {x,y+-sigma} with smoothing parameter mu.

Sigma are the uncertainties in the y data. 0 <= Mu <= 1 is the smoothing paremeter, mu=0 no smoothing, mu=1 maximal smoothing.

References SSpline< T >::calculateCoefficients().

template<typename T >
SSpline< T >::SSpline ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y,
const T  mu 
) [inline]

Construct an approximating spline to the data {x,y} with smoothing parameter mu.

All data are assumed to have the same weights. 0 <= Mu <= 1 is the smoothing paremeter, mu=0 no smoothing, mu=1 maximal smoothing.

References SSpline< T >::calculateCoefficients().

template<typename T >
virtual SSpline< T >::~SSpline (  )  [inline, virtual]

Member Function Documentation

template<typename T >
T SSpline< T >::eval ( const T  x  )  const [inline]
template<typename T >
T SSpline< T >::operator() ( const T  x  )  const [inline]

evaluate the spline at position x

References SSpline< T >::eval().

template<typename T >
T SSpline< T >::eval ( const T  x,
T *  dfdx1,
T *  dfdx2 
) const [inline]

evaluate the spline at position x, and return the first and second derivatives in dfdx1 and dfdx2, respectively. either may be NULL in which case the derivative is not evaluated.

References SSpline< T >::A, SSpline< T >::B, SSpline< T >::C, SSpline< T >::D, SSpline< T >::find_index(), and SSpline< T >::X.

template<typename T >
void SSpline< T >::calculateCoefficients ( const MArray< T, 1 > &  x,
const MArray< T, 1 > &  y,
const MArray< T, 1 > &  sigma,
const T  mu 
) [inline, protected]
template<typename T >
void SSpline< T >::quincunx ( MArray< T, 1 > &  u,
MArray< T, 1 > &  v,
MArray< T, 1 > &  w,
MArray< T, 1 > &  q 
) [inline, protected]

References v.

Referenced by SSpline< T >::calculateCoefficients().

template<typename T >
int SSpline< T >::find_index ( const MArray< T, 1 > &  X,
const T  x 
) const [inline, protected]

Given an MArray X, and given a value x, returns a value j such that x is between X(j) and X(j+1). X must be monotonically increasing. j=minIndex(X) or j=maxIndex(X)-1 is returned if x is out of range.

This routine uses bisection and scales as O(log2 N)

References SSpline< T >::X.

Referenced by SSpline< T >::eval().


Field Documentation

template<typename T >
MArray<T,1> SSpline< T >::X [protected]
template<typename T >
MArray<T,1> SSpline< T >::A [protected]
template<typename T >
MArray<T,1> SSpline< T >::B [protected]
template<typename T >
MArray<T,1> SSpline< T >::C [protected]
template<typename T >
MArray<T,1> SSpline< T >::D [protected]

Generated on 4 Nov 2015 for CURE by  doxygen 1.6.1