Diffpack Documentation
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Search
BSpline Class Reference
representation of usual B-spline function y=f(x).
More...
#include <BSpline.h>
List of all members.
Public Methods |
| | BSpline () |
| | ~BSpline () |
| bool | redim (const SplineSpace &space_) |
| bool | ok () const |
| SplineSpace | getSpace () const |
| void | getCoef (Vec(NUMT) &c) const |
| void | setCoef (const Vec(NUMT) &c) |
| NUMT | operator() (real x) |
| NUMT | derivative (int order, real x) |
| void | makeTable (const VecSimple(real) &vx, VecSimple(NUMT) &fx) |
| void | interpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f, bool repeat=false) |
| void | leastSquareInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f) |
| void | leastSquareInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f, const VecSimple(real) &weights) |
| void | linearInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f) |
| void | quadraticInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f) |
| void | cubicHermiteInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f, const VecSimple(real) &df) |
| void | cubicInterpolation (const VecSimple(real) &x, const VecSimple(NUMT) &f, const char *boundcond="Free", bool repeat=false) |
| void | scan (Is is) |
Protected Methods |
| NUMT | funcValue (int order, real x) |
Protected Attributes |
| SplineSpace | space |
| Vec(NUMT) | coef |
| SplineCurveInterpolBox | Ibox |
| Handle(MatBand(NUMT)) | A |
Detailed Description
representation of usual B-spline function y=f(x).
NAME: BSpline - representation of usual B-spline function y=f(x)
DESCRIPTION:
This class has one "SplineSpace", one "VecSimple(real)" and an instance of the tool class "SplineCurveInterpolBoxas" as its private data part. To calculate the spline function value correctly, the restriction that dimension of the space should be equal with length of the coefficient vector must be fulfilled.
Two kinds of interpolation are supported:
1. general interpolation: member function "interpolation" can only be called after "space" is already created. In other words, the order of the spline is decided by "space", and the input vector must has the length of "space"'s dimension.
2. special interpolation: in f.ex. member function "linearInterpolation", no space is needed when the function is called. It is inside the function where "space" and "coef" are built up at the same time
Calculation of the function''s derivatives is also allowed as long as the order is between "0" and "k-1".
Constructor & Destructor Documentation
|
BSpline::BSpline (
|
) [inline]
|
|
|
|
No special initialization needed. |
|
BSpline::~BSpline (
|
) [inline]
|
|
Member Function Documentation
|
|
cubic Hermite interpolation. A speacial case of cubic interpolation. Three "VecSimple(real)" objects should be sent in as input arguments. (Notice: a new spline space is built in the function!) |
|
void BSpline::cubicInterpolation (
|
const VecSimple(real) & x,
|
|
const VecSimple(NUMT) & f,
|
|
const char * boundcond = "Free",
|
|
bool repeat = false )
|
|
|
|
cubic interpolation ("k"=4) with different boundary conditions. (Notice: a new spline space is built in the function!) If no boundary condition is specified, the "Free" boundary condition is used as default. |
|
NUMT BSpline::derivative (
|
int order,
|
|
real x )
|
|
|
|
calculates the derivative value. (order kan be has the value between 0 and k-1, where order=0 returns the same result as "operator()".) |
|
NUMT BSpline::funcValue (
|
int order,
|
|
real x ) [protected]
|
|
|
void BSpline::getCoef (
|
Vec(NUMT) & c ) const [inline]
|
|
|
|
gets the coefficients of the spline. |
|
void BSpline::interpolation (
|
const VecSimple(real) & x,
|
|
const VecSimple(NUMT) & f,
|
|
bool repeat = false )
|
|
|
|
carries out an interpolation when the spline space is already built up. This function may prove to be not very pratical in normal cases. If there are too many interpolation conditions, a least square process will be taken. |
|
|
See documentation of one of the overloaded functions. |
|
void BSpline::leastSquareInterpolation (
|
const VecSimple(real) & x,
|
|
const VecSimple(NUMT) & f )
|
|
|
|
carries out an interpolation based on least squre theory. This is usually the case when we have too many interpolation conditions. Normally a "VecSimple(real)" weights should also be sent in. If not, we assumn that all the weights are equally 1.0. |
|
void BSpline::linearInterpolation (
|
const VecSimple(real) & x,
|
|
const VecSimple(NUMT) & f )
|
|
|
|
for the case of "k"=2. (Notice: the spline space is built up at the same time inside the function!). |
|
|
calculates spline function values for a vector of x-values. |
|
bool BSpline::ok (
|
) const [inline]
|
|
|
|
checks whether both spline space and coefficients are ready. |
|
NUMT BSpline::operator() (
|
real x )
|
|
|
void BSpline::quadraticInterpolation (
|
const VecSimple(real) & x,
|
|
const VecSimple(NUMT) & f )
|
|
|
|
for the case of "k"=3. (Notice: the spline space is built up inside the function!). |
|
bool BSpline::redim (
|
const SplineSpace & space_ ) [inline]
|
|
|
|
attaches a new spline space to the spline. |
|
void BSpline::scan (
|
Is is )
|
|
|
|
reads interpolating data directly from an ASCII file and carries out a cubic interpolation with boundary condition can be chosen between ""Free"" and ""Natural"". |
|
void BSpline::setCoef (
|
const Vec(NUMT) & c ) [inline]
|
|
|
|
assigns new coefficients. |
Member Data Documentation
Vec(NUMT) BSpline::coef [protected]
|
|
The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.