
SSJ V. 2.6. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object umontreal.iro.lecuyer.functionfit.BSpline
public class BSpline
Represents a Bspline with control points at (X_{i}, Y_{i}). Let P_{i} = (X_{i}, Y_{i}), for i = 0,…, n  1, be a control point and let t_{j}, for j = 0,…, m  1 be a knot. A Bspline of degree p = m  n  1 is a parametric curve defined as
N_{i, p}(t)  =  ((t  t_{i})/(t_{i+p}  t_{i}))N_{i, p1}(t) + ((t_{i+p+1}  t)/(t_{i+p+1}  t_{i+1}))N_{i+1, p1}(t)  
N_{i, 0}(t)  =  {1#1 
This class provides methods to evaluate
P(t) = (X(t), Y(t)) at any value of t,
for a Bspline of any degree p >= 1.
Note that the
evaluate
method
of this class can be slow, since it
uses a root finder to determine
the value of t^{*} for which X(t^{*}) = x
before it computes Y(t^{*}).
Constructor Summary  

BSpline(double[] x,
double[] y,
double[] knots)
Constructs a new uniform Bspline with control points at (x[i], y[i]), and knot vector given by the array knots. 

BSpline(double[] x,
double[] y,
int degree)
Constructs a new uniform Bspline of degree degree with control points at (x[i], y[i]). 
Method Summary  

static BSpline 
createApproxBSpline(double[] x,
double[] y,
int degree,
int h)
Returns a Bspline curve of degree degree smoothing (x_{i}, y_{i}), for i = 0,…, n points. 
static BSpline 
createInterpBSpline(double[] x,
double[] y,
int degree)
Returns a Bspline curve of degree degree interpolating the (x_{i}, y_{i}) points. 
double 
derivative(double u)
Computes (or estimates) the first derivative of the function at point x. 
double 
derivative(double u,
int n)
Computes (or estimates) the nth derivative of the function at point x. 
BSpline 
derivativeBSpline()
Returns the derivative Bspline object of the current variable. 
BSpline 
derivativeBSpline(int i)
Returns the ith derivative Bspline object of the current variable; i must be less than the degree of the original Bspline. 
double 
evaluate(double u)
Returns the value of the function evaluated at x. 
double 
evalX(double u)

double 
evalY(double u)

double[] 
getKnots()
Returns an array containing the knot vector (t_{0}, t_{m1}). 
double 
getMaxKnot()
Returns the knot maximal value. 
double 
getMinKnot()
Returns the knot minimal value. 
double[] 
getX()
Returns the X_{i} coordinates for this spline. 
double[] 
getY()
Returns the Y_{i} coordinates for this spline. 
double 
integral(double a,
double b)
Computes (or estimates) the integral of the function over the interval [a, b]. 
Methods inherited from class java.lang.Object 

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public BSpline(double[] x, double[] y, int degree)
x
 the values of X.y
 the values of Y.degree
 the degree of the Bspline.public BSpline(double[] x, double[] y, double[] knots)
x
 the values of X.y
 the values of Y.knots
 the knots of the Bspline.Method Detail 

public double[] getX()
public double[] getY()
public double getMaxKnot()
public double getMinKnot()
public double[] getKnots()
public static BSpline createInterpBSpline(double[] x, double[] y, int degree)
x
 the values of X.y
 the values of Y.degree
 the degree of the Bspline.
public static BSpline createApproxBSpline(double[] x, double[] y, int degree, int h)
x
 the values of X.y
 the values of Y.degree
 the degree of the Bspline.h
 the desired number of control points.
public BSpline derivativeBSpline()
public BSpline derivativeBSpline(int i)
i
 the degree of the derivative.
public double evaluate(double u)
MathFunction
evaluate
in interface MathFunction
u
 value at which the function is evaluated
public double integral(double a, double b)
MathFunctionWithIntegral
integral
in interface MathFunctionWithIntegral
a
 the starting point of the interval.b
 the ending point of the interval.
public double derivative(double u)
MathFunctionWithFirstDerivative
derivative
in interface MathFunctionWithFirstDerivative
u
 the point to evaluate the derivative to.
public double derivative(double u, int n)
MathFunctionWithDerivative
evaluate
.
derivative
in interface MathFunctionWithDerivative
u
 the point to evaluate the derivate to.n
 the order of the derivative.
public double evalX(double u)
public double evalY(double u)

SSJ V. 2.6. 

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 