|
EOL BSpline Library
Version 1.6
|
Used to evaluate a BSpline. More...
#include <BSpline.h>
Public Member Functions | |
| BSpline (const T *x, int nx, const T *y, double wl, int bc_type=BSplineBase< T >::BC_ZERO_SECOND, int num_nodes=0) | |
| Create a single spline with the parameters required to set up the domain and subsequently smooth the given set of y values. More... | |
| BSpline (BSplineBase< T > &base, const T *y) | |
A BSpline curve can be derived from a separate base and a set of data points y over that base. | |
| bool | solve (const T *y) |
| Solve the spline curve for a new set of y values. More... | |
| T | evaluate (T x) |
Return the evaluation of the smoothed curve at a particular x value. More... | |
| T | slope (T x) |
Return the first derivative of the spline curve at the given x. More... | |
| T | coefficient (int n) |
Return the n-th basis coefficient, from 0 to M. More... | |
Public Member Functions inherited from BSplineBase< T > | |
| BSplineBase (const T *x, int nx, double wl, int bc_type=BC_ZERO_SECOND, int num_nodes=0) | |
| Construct a spline domain for the given set of x values, cutoff wavelength, and boundary condition type. More... | |
| BSplineBase (const BSplineBase &) | |
| Copy constructor. | |
| bool | setDomain (const T *x, int nx, double wl, int bc_type=BC_ZERO_SECOND, int num_nodes=0) |
| Change the domain of this base. More... | |
| BSpline< T > * | apply (const T *y) |
| Create a BSpline smoothed curve for the given set of NX y values. More... | |
| const T * | nodes (int *nnodes) |
| Return array of the node coordinates. More... | |
| int | nNodes () |
| Return the number of nodes (one more than the number of intervals). | |
| int | nX () |
| Number of original x values. | |
| T | Xmin () |
| Minimum x value found. | |
| T | Xmax () |
| Maximum x value found. | |
| double | Alpha (double wavelength) |
| Return the Alpha value for a given wavelength. More... | |
| double | Alpha () |
| Return alpha currently in use by this domain. | |
| bool | ok () |
| Return the current state of the object, either ok or not ok. More... | |
Protected Attributes | |
| BSplineP< T > * | s |
| T | mean |
Protected Attributes inherited from BSplineBase< T > | |
| double | waveLength |
| int | NX |
| int | K |
| int | BC |
| T | xmax |
| T | xmin |
| int | M |
| double | DX |
| double | alpha |
| bool | OK |
| Base * | base |
Additional Inherited Members | |
Public Types inherited from BSplineBase< T > | |
| enum | BoundaryConditionTypes { BC_ZERO_ENDPOINTS = 0, BC_ZERO_FIRST = 1, BC_ZERO_SECOND = 2 } |
| Boundary condition types. More... | |
| typedef T | datum_type |
Static Public Member Functions inherited from BSplineBase< T > | |
| static const char * | ImplVersion () |
| Return a string describing the implementation version. | |
| static const char * | IfaceVersion () |
| Return a string describing the interface version. | |
| static bool | Debug (int on=-1) |
| Call this class method with a value greater than zero to enable debug messages, or with zero to disable messages. More... | |
Protected Types inherited from BSplineBase< T > | |
| typedef BSplineBaseP< T > | Base |
Protected Member Functions inherited from BSplineBase< T > | |
| bool | Setup (int num_nodes=0) |
| void | calculateQ () |
| double | qDelta (int m1, int m2) |
| double | Beta (int m) |
| void | addP () |
| bool | factor () |
| double | Basis (int m, T x) |
| double | DBasis (int m, T x) |
| double | Ratiod (int &, double &, double &) |
Static Protected Attributes inherited from BSplineBase< T > | |
| static const double | BoundaryConditions [3][4] |
| static const double | PI = 3.1415927 |
Used to evaluate a BSpline.
Inherits the BSplineBase domain information and interface and adds smoothing. See the BSplineBase documentation for a summary of the BSpline interface.
| BSpline< T >::BSpline | ( | const T * | x, |
| int | nx, | ||
| const T * | y, | ||
| double | wl, | ||
| int | bc_type = BSplineBase<T>::BC_ZERO_SECOND, |
||
| int | num_nodes = 0 |
||
| ) |
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. |
| T BSpline< T >::coefficient | ( | int | n | ) |
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.
| T BSpline< T >::evaluate | ( | T | x | ) |
Return the evaluation of the smoothed curve at a particular x value.
If current state is not ok(), returns 0.
| T BSpline< T >::slope | ( | T | x | ) |
Return the first derivative of the spline curve at the given x.
Returns zero if the current state is not ok().
| bool BSpline< T >::solve | ( | const T * | y | ) |
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. |
1.8.11