Inherits BSpline::BSplineBase< T >.
Inherit the BSplineBase domain information and interface and add smoothing. See the BSplineBase documentation for a summary of the BSpline interface.
typedef T BSpline::BSpline< T >::value_type |
typedef T BSpline::BSplineBase< T >::datum_type [inherited] |
typedef BSplineBaseP<T> BSpline::BSplineBase< T >::Base [protected, inherited] |
enum BSpline::BSplineBase::BoundaryConditionTypes [inherited] |
BSpline::BSpline< T >::BSpline | ( | const T * | x, | |
int | nx, | |||
const T * | y, | |||
T | 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.
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. | |
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 BSpline::BSpline< T >::solve().
BSpline::BSpline< T >::BSpline | ( | BSplineBase< T > & | base, | |
const T * | y | |||
) | [inline] |
A BSpline curve can be derived from a separate base
and a set of data points y
over that base.
References BSpline::BSpline< T >::solve().
BSpline::BSpline< T >::~BSpline | ( | ) | [inline, virtual] |
bool BSpline::BSpline< T >::solve | ( | const T * | y | ) | [inline] |
Solve the spline curve for a new set of y values. Returns false if the solution fails.
y | The array of y values corresponding to each of the nX() x values in the domain. |
References BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::Basis(), BSpline::BSplineBase< T >::BasisInner(), BSpline::BSplineBase< T >::DX, BSpline::LU_solve_banded(), BSpline::BSplineBase< T >::M, BSpline::my::max(), BSpline::BSpline< T >::mean, BSpline::my::min(), BSpline::BSplineBase< T >::NX, BSpline::BSplineBase< T >::OK, BSpline::BSplineBaseP< T >::Q, BSpline::BSpline< T >::s, BSpline::BSplineBaseP< T >::X, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSpline< T >::BSpline().
const T * BSpline::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.
nx | If non-zero, returns the number of points in the curve. |
References BSpline::BSplineBase< T >::DX, BSpline::BSpline< T >::evaluate(), BSpline::BSplineBase< T >::M, BSpline::BSplineBase< T >::OK, BSpline::BSpline< T >::s, and BSpline::BSplineBase< T >::xmin.
T BSpline::BSpline< T >::evaluate | ( | T | x | ) | const [inline] |
Return the evaluation of the smoothed curve at a particular x
value. If current state is not ok(), returns 0.
References BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, BSpline::my::max(), BSpline::BSpline< T >::mean, BSpline::my::min(), BSpline::BSplineBase< T >::OK, BSpline::BSpline< T >::s, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSpline< T >::curve(), SuperSky::fix_spline_average(), BSpline::BSpline< T >::operator()(), SuperSky::propagate_error(), and SuperSky::subtract_sky_from_line().
T BSpline::BSpline< T >::operator() | ( | T | x | ) | const [inline] |
Return the evaluation of the smoothed curve at a particular x
value. Operator version. If current state is not ok(), returns 0.
References BSpline::BSpline< T >::evaluate().
T BSpline::BSpline< T >::slope | ( | T | x | ) | [inline] |
Return the first derivative of the spline curve at the given x
. Returns zero if the current state is not ok().
References BSpline::BSplineBase< T >::DBasis(), BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, BSpline::my::max(), BSpline::my::min(), BSpline::BSplineBase< T >::OK, BSpline::BSpline< T >::s, and BSpline::BSplineBase< T >::xmin.
T BSpline::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 BSpline::BSplineBase< T >::M, BSpline::BSplineBase< T >::OK, and BSpline::BSpline< T >::s.
static const char* BSpline::BSplineBase< T >::ImplVersion | ( | ) | [static, inherited] |
static const char* BSpline::BSplineBase< T >::IfaceVersion | ( | ) | [static, inherited] |
bool BSpline::BSplineBase< T >::setDomain | ( | const T * | x, | |
int | nx, | |||
T | 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.
x | The array of x values in the domain. | |
nx | The number of values in the x array. | |
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. |
References BSpline::BSplineBase< T >::addP(), BSpline::BSplineBase< T >::Alpha(), BSpline::BSplineBase< T >::alpha, BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::BC, BSpline::BSplineBase< T >::calculateQ(), BSpline::BSplineBase< T >::factor(), BSpline::BSplineBase< T >::NX, BSpline::BSplineBase< T >::OK, BSpline::BSplineBase< T >::Setup(), BSpline::BSplineBase< T >::waveLength, and BSpline::BSplineBaseP< T >::X.
Referenced by BSpline::BSplineBase< T >::BSplineBase().
BSpline< T > * BSpline::BSplineBase< T >::apply | ( | const T * | y | ) | [inline, inherited] |
const T * BSpline::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 BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, BSpline::BSplineBaseP< T >::Nodes, and BSpline::BSplineBase< T >::xmin.
int BSpline::BSplineBase< T >::nNodes | ( | ) | [inline, inherited] |
Return the number of nodes (one more than the number of intervals).
References BSpline::BSplineBase< T >::M.
int BSpline::BSplineBase< T >::nX | ( | ) | [inline, inherited] |
Number of original x values.
References BSpline::BSplineBase< T >::NX.
T BSpline::BSplineBase< T >::Xmin | ( | ) | [inline, inherited] |
References BSpline::BSplineBase< T >::xmin.
T BSpline::BSplineBase< T >::Xmax | ( | ) | [inline, inherited] |
T BSpline::BSplineBase< T >::Alpha | ( | T | wavelength | ) | [inline, inherited] |
Return the Alpha value for a given wavelength. Note that this depends on the current node interval length (DX).
References a, BSpline::BSplineBase< T >::DX, and BSpline::BSplineBase< T >::K.
T BSpline::BSplineBase< T >::Alpha | ( | ) | [inline, inherited] |
Return alpha currently in use by this domain.
References BSpline::BSplineBase< T >::alpha.
Referenced by BSpline::BSplineBase< T >::setDomain().
bool BSpline::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 BSpline::BSplineBase< T >::OK.
bool BSpline::BSplineBase< T >::Setup | ( | int | num_nodes = 0 |
) | [inline, protected, inherited] |
References BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, BSpline::BSplineBase< T >::NX, BSpline::BSplineBase< T >::Ratiod(), BSpline::BSplineBase< T >::waveLength, BSpline::BSplineBaseP< T >::X, BSpline::BSplineBase< T >::xmax, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSplineBase< T >::setDomain().
void BSpline::BSplineBase< T >::calculateQ | ( | ) | [inline, protected, inherited] |
References BSpline::BSplineBase< T >::alpha, BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::Beta(), BSpline::BSplineBase< T >::M, BSpline::BSplineBaseP< T >::Q, Q, BSpline::BSplineBase< T >::qDelta(), and BSpline::BandedMatrix< T >::setup().
Referenced by BSpline::BSplineBase< T >::setDomain().
T BSpline::BSplineBase< T >::qDelta | ( | int | m1, | |
int | m2 | |||
) | [inline, protected, inherited] |
T BSpline::BSplineBase< T >::Beta | ( | int | m | ) | const [inline, protected, inherited] |
void BSpline::BSplineBase< T >::addP | ( | ) | [inline, protected, inherited] |
References BSpline::BSplineBase< T >::base, BSpline::BSplineBase< T >::Basis(), BSpline::BSplineBase< T >::BasisInner(), BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, BSpline::my::max(), BSpline::my::min(), BSpline::BSplineBase< T >::NX, P, BSpline::BSplineBaseP< T >::Q, BSpline::BSplineBaseP< T >::X, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSplineBase< T >::setDomain().
bool BSpline::BSplineBase< T >::factor | ( | ) | [inline, protected, inherited] |
References BSpline::BSplineBase< T >::base, BSpline::LU_factor_banded(), and BSpline::BSplineBaseP< T >::Q.
Referenced by BSpline::BSplineBase< T >::setDomain().
T BSpline::BSplineBase< T >::Basis | ( | int | m, | |
T | x | |||
) | const [inline, protected, inherited] |
T BSpline::BSplineBase< T >::BasisInner | ( | int | m, | |
T | x | |||
) | const [inline, protected, inherited] |
References BSpline::BSplineBase< T >::DX, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSplineBase< T >::addP(), and BSpline::BSpline< T >::solve().
T BSpline::BSplineBase< T >::DBasis | ( | int | m, | |
T | x | |||
) | [inline, protected, inherited] |
References BSpline::BSplineBase< T >::Beta(), BSpline::BSplineBase< T >::DX, BSpline::BSplineBase< T >::M, and BSpline::BSplineBase< T >::xmin.
Referenced by BSpline::BSpline< T >::slope().
T BSpline::BSplineBase< T >::Ratiod | ( | int & | ni, | |
T & | deltax, | |||
T & | ratiof | |||
) | [inline, protected, inherited] |
BSplineP<T> BSpline::BSpline< T >::s [protected] |
T BSpline::BSpline< T >::mean [protected] |
Referenced by BSpline::BSpline< T >::evaluate(), and BSpline::BSpline< T >::solve().
T BSpline::BSplineBase< T >::waveLength [protected, inherited] |
int BSpline::BSplineBase< T >::NX [protected, inherited] |
int BSpline::BSplineBase< T >::K [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::Alpha(), and BSpline::BSplineBase< T >::qDelta().
int BSpline::BSplineBase< T >::BC [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::Beta(), and BSpline::BSplineBase< T >::setDomain().
T BSpline::BSplineBase< T >::xmax [protected, inherited] |
T BSpline::BSplineBase< T >::xmin [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::addP(), BSpline::BSplineBase< T >::Basis(), BSpline::BSplineBase< T >::BasisInner(), BSpline::BSplineBase< T >::BSplineBase(), BSpline::BSpline< T >::curve(), BSpline::BSplineBase< T >::DBasis(), BSpline::BSpline< T >::evaluate(), BSpline::BSplineBase< T >::nodes(), BSpline::BSplineBase< T >::Ratiod(), BSpline::BSplineBase< T >::Setup(), BSpline::BSpline< T >::slope(), BSpline::BSpline< T >::solve(), BSpline::BSplineBase< T >::Xmax(), and BSpline::BSplineBase< T >::Xmin().
int BSpline::BSplineBase< T >::M [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::addP(), BSpline::BSplineBase< T >::Basis(), BSpline::BSplineBase< T >::Beta(), BSpline::BSplineBase< T >::BSplineBase(), BSpline::BSplineBase< T >::calculateQ(), BSpline::BSpline< T >::coefficient(), BSpline::BSpline< T >::curve(), BSpline::BSplineBase< T >::DBasis(), BSpline::BSpline< T >::evaluate(), BSpline::BSplineBase< T >::nNodes(), BSpline::BSplineBase< T >::nodes(), BSpline::BSplineBase< T >::qDelta(), BSpline::BSplineBase< T >::Setup(), BSpline::BSpline< T >::slope(), BSpline::BSpline< T >::solve(), and BSpline::BSplineBase< T >::Xmax().
T BSpline::BSplineBase< T >::DX [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::addP(), BSpline::BSplineBase< T >::Alpha(), BSpline::BSplineBase< T >::Basis(), BSpline::BSplineBase< T >::BasisInner(), BSpline::BSplineBase< T >::BSplineBase(), BSpline::BSpline< T >::curve(), BSpline::BSplineBase< T >::DBasis(), BSpline::BSpline< T >::evaluate(), BSpline::BSplineBase< T >::nodes(), BSpline::BSplineBase< T >::Setup(), BSpline::BSpline< T >::slope(), BSpline::BSpline< T >::solve(), and BSpline::BSplineBase< T >::Xmax().
T BSpline::BSplineBase< T >::alpha [protected, inherited] |
bool BSpline::BSplineBase< T >::OK [protected, inherited] |
Base* BSpline::BSplineBase< T >::base [protected, inherited] |
Referenced by BSpline::BSplineBase< T >::addP(), BSpline::BSplineBase< T >::BSplineBase(), BSpline::BSplineBase< T >::calculateQ(), BSpline::BSplineBase< T >::factor(), BSpline::BSplineBase< T >::nodes(), BSpline::BSplineBase< T >::setDomain(), BSpline::BSplineBase< T >::Setup(), BSpline::BSpline< T >::solve(), and BSpline::BSplineBase< T >::~BSplineBase().
const T BSpline::BSplineBase< T >::BoundaryConditions [inline, static, protected, inherited] |
{ { -4, -1, -1, -4 }, { 0, 1, 1, 0 }, { 2, -1, -1, 2 } }
Referenced by BSpline::BSplineBase< T >::Beta().