BWSpline::BSpline< T > Class Template Reference

Inherits BWSpline::BSplineBase< T >.

Public Types

Public Member Functions

Static Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes

Static Protected Attributes


Detailed Description

template<class T>
class BWSpline::BSpline< T >

Inherit the BSplineBase domain information and interface and add smoothing. See the BSplineBase documentation for a summary of the BSpline interface.


Member Typedef Documentation

template<class T>
typedef T BWSpline::BSpline< T >::value_type
template<class T>
typedef T BWSpline::BSplineBase< T >::datum_type [inherited]
template<class T>
typedef BSplineBaseP<T> BWSpline::BSplineBase< T >::Base [protected, inherited]

Member Enumeration Documentation

template<class T>
anonymous enum
Enumerator:
isVectorizable 
template<class T>
enum BWSpline::BSplineBase::BoundaryConditionTypes [inherited]

Boundary condition types.

Enumerator:
BC_ZERO_ENDPOINTS 

Set the endpoints of the spline to zero.

BC_ZERO_FIRST 

Set the first derivative of the spline to zero at the endpoints.

BC_ZERO_SECOND 

Set the second derivative to zero.


Constructor & Destructor Documentation

template<class T >
BWSpline::BSpline< T >::BSpline ( const T *  x,
int  nx,
const T *  y,
const T *  w,
wl,
int  bc_type = BSplineBase<T>::BC_ZERO_SECOND,
int  num_nodes = 0 
) [inline]

Create a single spline with the parameters required to set up the domain and subsequently smooth the given set of y values. The y values must correspond to each of the values in the x array. If either the domain setup fails or the spline cannot be solved, the state will be set to not ok.

See also:
ok().
Parameters:
x The array of x values in the domain.
nx The number of values in the x array.
y The array of y values corresponding to each of the nX() x values in the domain.
w The array of weights for the x values.
wl The cutoff wavelength, in the same units as the x values. A wavelength of zero disables the derivative constraint.
bc_type The enumerated boundary condition type. If omitted it defaults to BC_ZERO_SECOND.
num_nodes The number of nodes to use for the cubic b-spline. If less than 2 a "reasonable" number will be calculated automatically, taking into account the given cutoff wavelength.

References BWSpline::BSpline< T >::solve().

template<class T >
BWSpline::BSpline< T >::BSpline ( BSplineBase< T > &  base,
const T *  y,
const T *  w 
) [inline]

A BSpline curve can be derived from a separate base and a set of data points y and errors w over that base.

References BWSpline::BSpline< T >::solve().

template<class T >
BWSpline::BSpline< T >::~BSpline (  )  [inline, virtual]

Member Function Documentation

template<class T >
bool BWSpline::BSpline< T >::solve ( const T *  y,
const T *  w 
) [inline]

Solve the spline curve for a new set of y values. Returns false if the solution fails.

Parameters:
y The array of y values corresponding to each of the nX() x values in the domain.
w The array of error values corresponding to each of the nX() y values in the domain.

References BWSpline::BSplineBase< T >::base, BWSpline::BSplineBase< T >::Basis(), BWSpline::BSplineBase< T >::BasisInner(), BWSpline::BSplineBase< T >::DX, BWSpline::LU_solve_banded(), BWSpline::BSplineBase< T >::M, BWSpline::my::max(), BWSpline::BSpline< T >::mean, BWSpline::my::min(), BWSpline::BSplineBase< T >::NX, BWSpline::BSplineBase< T >::OK, BWSpline::BSplineBaseP< T >::Q, BWSpline::BSpline< T >::s, BWSpline::BSplineBaseP< T >::X, and BWSpline::BSplineBase< T >::xmin.

Referenced by BWSpline::BSpline< T >::BSpline().

template<class T >
const T * BWSpline::BSpline< T >::curve ( int *  nx = 0  )  [inline]

Return the entire curve evaluated at each of the nodes. The array is held by the object, and thus should not be freed and is only valid while the object exists. If the current state is not ok(), the method returns zero.

Parameters:
nx If non-zero, returns the number of points in the curve.

References BWSpline::BSplineBase< T >::DX, BWSpline::BSpline< T >::evaluate(), BWSpline::BSplineBase< T >::M, BWSpline::BSplineBase< T >::OK, BWSpline::BSpline< T >::s, and BWSpline::BSplineBase< T >::xmin.

template<class T >
T BWSpline::BSpline< T >::evaluate ( x  )  [inline]
template<class T>
T BWSpline::BSpline< T >::operator() ( x  )  [inline]

Return the evaluation of the smoothed curve at a particular x value. If current state is not ok(), returns 0.

References BWSpline::BSpline< T >::evaluate().

template<class T >
T BWSpline::BSpline< T >::slope ( x  )  [inline]
template<class T >
T BWSpline::BSpline< T >::coefficient ( int  n  )  [inline]

Return the n-th basis coefficient, from 0 to M. If the current state is not ok(), or n is out of range, the method returns zero.

References BWSpline::BSplineBase< T >::M, BWSpline::BSplineBase< T >::OK, and BWSpline::BSpline< T >::s.

template<class T>
static const char* BWSpline::BSplineBase< T >::ImplVersion (  )  [static, inherited]
template<class T>
static const char* BWSpline::BSplineBase< T >::IfaceVersion (  )  [static, inherited]
template<class T >
bool BWSpline::BSplineBase< T >::setDomain ( const T *  x,
int  nx,
const T *  w,
wl,
int  bc_type = BC_ZERO_SECOND,
int  num_nodes = 0 
) [inline, inherited]

Change the domain of this base. [If this is part of a BSpline object, this method {will not} change the existing curve or re-apply the smoothing to any set of y values.]

The x values can be in any order, but they must be of sufficient density to support the requested cutoff wavelength. The setup of the domain may fail because of either inconsistency between the x density and the cutoff wavelength, or because the resulting matrix could not be factored. If setup fails, the method returns false.

Parameters:
x The array of x values in the domain.
nx The number of values in the x array.
w The array of weights for the x values.
wl The cutoff wavelength, in the same units as the x values. A wavelength of zero disables the derivative constraint.
bc_type The enumerated boundary condition type. If omitted it defaults to BC_ZERO_SECOND.
num_nodes The number of nodes to use for the cubic b-spline. If less than 2 a reasonable number will be calculated automatically, if possible, taking into account the given cutoff wavelength.
See also:
ok().

References BWSpline::BSplineBase< T >::addP(), BWSpline::BSplineBase< T >::Alpha(), BWSpline::BSplineBase< T >::alpha, BWSpline::BSplineBase< T >::base, BWSpline::BSplineBase< T >::BC, BWSpline::BSplineBase< T >::calculateQ(), BWSpline::BSplineBase< T >::factor(), BWSpline::BSplineBase< T >::NX, BWSpline::BSplineBase< T >::OK, BWSpline::BSplineBase< T >::Setup(), BWSpline::BSplineBase< T >::waveLength, and BWSpline::BSplineBaseP< T >::X.

Referenced by BWSpline::BSplineBase< T >::BSplineBase().

template<class T >
BSpline< T > * BWSpline::BSplineBase< T >::apply ( const T *  y  )  [inline, inherited]

Create a BSpline smoothed curve for the given set of NX y values. The returned object will need to be deleted by the caller.

Parameters:
y The array of y values corresponding to each of the nX() x values in the domain.
See also:
ok()
template<class T >
const T * BWSpline::BSplineBase< T >::nodes ( int *  nnodes  )  [inline, inherited]

Return array of the node coordinates. Returns 0 if not ok(). The array of nodes returned by nodes() belongs to the object and should not be deleted; it will also be invalid if the object is destroyed.

References BWSpline::BSplineBase< T >::base, BWSpline::BSplineBase< T >::DX, BWSpline::BSplineBase< T >::M, BWSpline::BSplineBaseP< T >::Nodes, and BWSpline::BSplineBase< T >::xmin.

template<class T>
int BWSpline::BSplineBase< T >::nNodes (  )  [inline, inherited]

Return the number of nodes (one more than the number of intervals).

References BWSpline::BSplineBase< T >::M.

template<class T>
int BWSpline::BSplineBase< T >::nX (  )  [inline, inherited]

Number of original x values.

References BWSpline::BSplineBase< T >::NX.

template<class T>
T BWSpline::BSplineBase< T >::Xmin (  )  [inline, inherited]
template<class T>
T BWSpline::BSplineBase< T >::Xmax (  )  [inline, inherited]
template<class T >
T BWSpline::BSplineBase< T >::Alpha ( wavelength  )  [inline, inherited]

Return the Alpha value for a given wavelength. Note that this depends on the current node interval length (DX).

References a, BWSpline::BSplineBase< T >::DX, and BWSpline::BSplineBase< T >::K.

template<class T>
T BWSpline::BSplineBase< T >::Alpha (  )  [inline, inherited]

Return alpha currently in use by this domain.

References BWSpline::BSplineBase< T >::alpha.

Referenced by BWSpline::BSplineBase< T >::setDomain().

template<class T>
bool BWSpline::BSplineBase< T >::ok (  )  [inline, inherited]

Return the current state of the object, either ok or not ok. Use this method to test for valid state after construction or after a call to setDomain(). ok() will return false if either fail, such as when an appropriate number of nodes and node interval cannot be found for a given wavelength, or when the linear equation for the coefficients cannot be solved.

References BWSpline::BSplineBase< T >::OK.

template<class T >
bool BWSpline::BSplineBase< T >::Setup ( int  num_nodes = 0  )  [inline, protected, inherited]
template<class T >
void BWSpline::BSplineBase< T >::calculateQ (  )  [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::qDelta ( int  m1,
int  m2 
) [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::Beta ( int  m  )  [inline, protected, inherited]
template<class T >
void BWSpline::BSplineBase< T >::addP ( const T *  w  )  [inline, protected, inherited]
template<class T >
bool BWSpline::BSplineBase< T >::factor (  )  [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::Basis ( int  m,
x 
) [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::BasisInner ( int  m,
x 
) [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::DBasis ( int  m,
x 
) [inline, protected, inherited]
template<class T >
T BWSpline::BSplineBase< T >::Ratiod ( int &  ni,
T &  deltax,
T &  ratiof 
) [inline, protected, inherited]

Field Documentation

template<class T>
BSplineP<T> BWSpline::BSpline< T >::s [protected]
template<class T>
T BWSpline::BSpline< T >::mean [protected]
template<class T>
T BWSpline::BSplineBase< T >::waveLength [protected, inherited]
template<class T>
int BWSpline::BSplineBase< T >::NX [protected, inherited]
template<class T>
int BWSpline::BSplineBase< T >::K [protected, inherited]
template<class T>
int BWSpline::BSplineBase< T >::BC [protected, inherited]
template<class T>
T BWSpline::BSplineBase< T >::xmax [protected, inherited]
template<class T>
T BWSpline::BSplineBase< T >::xmin [protected, inherited]
template<class T>
int BWSpline::BSplineBase< T >::M [protected, inherited]
template<class T>
T BWSpline::BSplineBase< T >::DX [protected, inherited]
template<class T>
T BWSpline::BSplineBase< T >::alpha [protected, inherited]
template<class T>
bool BWSpline::BSplineBase< T >::OK [protected, inherited]
template<class T>
Base* BWSpline::BSplineBase< T >::base [protected, inherited]
template<class T>
const T BWSpline::BSplineBase< T >::BoundaryConditions [inline, static, protected, inherited]
Initial value:
{

   { -4, -1, -1, -4 },
   { 0, 1, 1, 0 },
   { 2, -1, -1, 2 } }

Referenced by BWSpline::BSplineBase< T >::Beta().


Generated on 4 Nov 2015 for CURE by  doxygen 1.6.1