KrisLibrary
1.0.0
|
Defines the B-spline basis for a given knot vector, number of control points. More...
#include <BSpline.h>
Public Member Functions | |
void | SetUniformKnots (size_t numCps, size_t degree, Real h=One) |
Sets the knots to be uniformly spaced with valid t in [0,h*(numCps-degree)]. | |
void | SetClosedKnots (size_t numCps, size_t degree, Real h=One) |
Sets the knots to be closed (interpolate endpoints) with t in [0,h*(numCps-degree)]. | |
int | Degree () const |
Returns the degree p. | |
std::pair< int, int > | Support (int k) const |
std::pair< int, int > | Domain (int k) const |
Real | StartTime () const |
Real | EndTime () const |
int | GetKnot (Real t) const |
Returns the furthest knot k such that knots[k]<=t<knots[k+1]. | |
void | Evaluate (Real t, SparseVector &basis) const |
Returns a vector of length n+1 whose elements are the spline coefficients x(t) = sum_i basis(i)*xi. | |
void | Evaluate (int k, SparseMatrix &basis) const |
Returns a matrix B of dimension n+1 x p+1 whose elements give the spline coefficients for knots[k] <= t <= knots[k+1]. More... | |
void | Deriv (Real t, SparseVector &basis) const |
Returns a vector of length n+1 whose elements are the spline derivative coefficients x'(t) = sum_i basis(i)*xi. | |
void | Deriv2 (Real t, SparseVector &basis) const |
Returns a vector of length n+1 whose elements are the spline acceleration coefficients x''(t) = sum_i basis(i)*xi. | |
void | EvaluateWithDerivs (Real t, SparseVector &b, SparseVector &db) const |
Saves some computation from calling Evaluate(),Deriv(), and Deriv2() | |
void | EvaluateWithDerivs (Real t, SparseVector &b, SparseVector &db, SparseVector &ddb) const |
void | EvaluateWithDerivs (Real t, std::vector< SparseVector > &db) const |
If n=db.size(), evaluates the i'th derivative in db[i]. | |
bool | IsValid () const |
Public Attributes | |
int | numControlPoints |
std::vector< Real > | knots |
Defines the B-spline basis for a given knot vector, number of control points.
Let m = knots.size()-1, n=numControlPoints-1. The degree of the b-spline is p=m-n-1.
Control points are x0,...,xn, the spline x(t) is defined for t in [knots[p],knots[m-p])
|
inline |
Returns the range of intervals knots[first]<=t<=knots[second+1] over which basis function k is defined
void Spline::BSplineBasis::Evaluate | ( | int | k, |
SparseMatrix & | basis | ||
) | const |
Returns a matrix B of dimension n+1 x p+1 whose elements give the spline coefficients for knots[k] <= t <= knots[k+1].
The spline is given as x(t) = X B T, where T=[1, t, t^2, ... t^p] and X = [x0 | x1 | ... | xn]
|
inline |
Returns the range of basis functions with support over the interval knots[k]<=t<knots[k+1]