Documentation of 'umontreal.iro.lecuyer.functionfit.BSpline' Java class
BSpline
umontreal.iro.lecuyer.functionfit

Class BSpline

    • Constructor Summary

      Constructors 
      Constructor and Description
      BSpline(double[] x, double[] y, double[] knots)
      Constructs a new uniform B-spline 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 B-spline of degree degree with control points at (x[i], y[i]).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static BSpline createApproxBSpline(double[] x, double[] y, int degree, int h)
      Returns a B-spline curve of degree degree smoothing (xi, yi), for i = 0,…, n points.
      static BSpline createInterpBSpline(double[] x, double[] y, int degree)
      Returns a B-spline curve of degree degree interpolating the (xi, yi) 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 B-spline object of the current variable.
      BSpline derivativeBSpline(int i)
      Returns the ith derivative B-spline object of the current variable; i must be less than the degree of the original B-spline.
      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 (t0, tm-1).
      double getMaxKnot()
      Returns the knot maximal value.
      double getMinKnot()
      Returns the knot minimal value.
      double[] getX()
      Returns the Xi coordinates for this spline.
      double[] getY()
      Returns the Yi 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

      • BSpline

        public BSpline(double[] x,
                       double[] y,
                       int degree)
        Constructs a new uniform B-spline of degree degree with control points at (x[i], y[i]). The knots of the resulting B-spline are set uniformly from x[0] to x[n-1].
        Parameters:
        x - the values of X.
        y - the values of Y.
        degree - the degree of the B-spline.
      • BSpline

        public BSpline(double[] x,
                       double[] y,
                       double[] knots)
        Constructs a new uniform B-spline with control points at (x[i], y[i]), and knot vector given by the array knots.
        Parameters:
        x - the values of X.
        y - the values of Y.
        knots - the knots of the B-spline.
    • Method Detail

      • getX

        public double[] getX()
        Returns the Xi coordinates for this spline.
        Returns:
        the Xi coordinates.
      • getY

        public double[] getY()
        Returns the Yi coordinates for this spline.
        Returns:
        the Yi coordinates.
      • getMaxKnot

        public double getMaxKnot()
        Returns the knot maximal value.
        Returns:
        the Yi coordinates.
      • getMinKnot

        public double getMinKnot()
        Returns the knot minimal value.
        Returns:
        the Yi coordinates.
      • getKnots

        public double[] getKnots()
        Returns an array containing the knot vector (t0, tm-1).
        Returns:
        the knot vector.
      • createInterpBSpline

        public static BSpline createInterpBSpline(double[] x,
                                                  double[] y,
                                                  int degree)
        Returns a B-spline curve of degree degree interpolating the (xi, yi) points. This method uses the uniformly spaced method for interpolating points with a B-spline curve, and a uniformed clamped knot vector, as described in http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/.
        Parameters:
        x - the values of X.
        y - the values of Y.
        degree - the degree of the B-spline.
        Returns:
        the B-spline curve.
      • createApproxBSpline

        public static BSpline createApproxBSpline(double[] x,
                                                  double[] y,
                                                  int degree,
                                                  int h)
        Returns a B-spline curve of degree degree smoothing (xi, yi), for i = 0,…, n points. The precision depends on the parameter h: 1 <= degree <= h < n, which represents the number of control points used by the new B-spline curve, minimizing the quadratic error

        L = ∑i=0n($\displaystyle {\frac{{Y_i - S_i(X_i)}}{{W_i}}}$)2.

        This method uses the uniformly spaced method for interpolating points with a B-spline curve and a uniformed clamped knot vector, as described in http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/.
        Parameters:
        x - the values of X.
        y - the values of Y.
        degree - the degree of the B-spline.
        h - the desired number of control points.
        Returns:
        the B-spline curve.
      • derivativeBSpline

        public BSpline derivativeBSpline()
        Returns the derivative B-spline object of the current variable. Using this function and the returned object, instead of the derivative method, is strongly recommended if one wants to compute many derivative values.
        Returns:
        the derivative B-spline of the current variable.
      • derivativeBSpline

        public BSpline derivativeBSpline(int i)
        Returns the ith derivative B-spline object of the current variable; i must be less than the degree of the original B-spline. Using this function and the returned object, instead of the derivative method, is strongly recommended if one wants to compute many derivative values.
        Parameters:
        i - the degree of the derivative.
        Returns:
        the ith derivative.
      • evaluate

        public double evaluate(double u)
        Description copied from interface: MathFunction
        Returns the value of the function evaluated at x.
        Specified by:
        evaluate in interface MathFunction
        Parameters:
        u - value at which the distribution function is evaluated
        Returns:
        function evaluated at x
      • integral

        public double integral(double a,
                               double b)
        Description copied from interface: MathFunctionWithIntegral
        Computes (or estimates) the integral of the function over the interval [a, b].
        Specified by:
        integral in interface MathFunctionWithIntegral
        Parameters:
        a - the starting point of the interval.
        b - the ending point of the interval.
        Returns:
        the value of the integral.
      • derivative

        public double derivative(double u,
                                 int n)
        Description copied from interface: MathFunctionWithDerivative
        Computes (or estimates) the nth derivative of the function at point x. For n = 0, this returns the result of evaluate.
        Specified by:
        derivative in interface MathFunctionWithDerivative
        Parameters:
        u - the point to evaluate the derivate to.
        n - the order of the derivative.
        Returns:
        the resulting derivative.
      • evalX

        public double evalX(double u)
      • evalY

        public double evalY(double u)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.