Class PiecewisePolynomialFunction1D

    • Constructor Detail

      • PiecewisePolynomialFunction1D

        public PiecewisePolynomialFunction1D()
        Creates an instance.
    • Method Detail

      • evaluate

        public DoubleArray evaluate​(PiecewisePolynomialResult pp,
                                    double xKey)
        Evaluates the function.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKey - the key
        Returns:
        the values of piecewise polynomial functions at xKey When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple splines, an element in the return values corresponds to each spline
      • evaluate

        public DoubleMatrix evaluate​(PiecewisePolynomialResult pp,
                                     double[] xKeys)
        Evaluates the function.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKeys - the key
        Returns:
        the values of piecewise polynomial functions at xKeys When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, a row vector of return value corresponds to each piecewise polynomial
      • evaluate

        public DoubleMatrix[] evaluate​(PiecewisePolynomialResult pp,
                                       double[][] xKeys)
        Evaluates the function.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKeys - the key
        Returns:
        the values of piecewise polynomial functions at xKeys When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, one element of return vector of DoubleMatrix corresponds to each piecewise polynomial
      • differentiate

        public DoubleArray differentiate​(PiecewisePolynomialResult pp,
                                         double xKey)
        Finds the first derivatives.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKey - the key
        Returns:
        the first derivatives of piecewise polynomial functions at xKey When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, an element in the return values corresponds to each piecewise polynomial
      • differentiate

        public DoubleMatrix differentiate​(PiecewisePolynomialResult pp,
                                          double[] xKeys)
        Finds the first derivatives.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKeys - the key
        Returns:
        the first derivatives of piecewise polynomial functions at xKeys When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, a row vector of return value corresponds to each piecewise polynomial
      • differentiateTwice

        public DoubleArray differentiateTwice​(PiecewisePolynomialResult pp,
                                              double xKey)
        Finds the second derivatives.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKey - the key
        Returns:
        the second derivatives of piecewise polynomial functions at xKey When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, an element in the return values corresponds to each piecewise polynomial
      • differentiateTwice

        public DoubleMatrix differentiateTwice​(PiecewisePolynomialResult pp,
                                               double[] xKeys)
        Finds the second derivatives.
        Parameters:
        pp - the PiecewisePolynomialResult
        xKeys - the key
        Returns:
        the second derivatives of piecewise polynomial functions at xKeys When _dim in PiecewisePolynomialResult is greater than 1, i.e., the struct contains multiple piecewise polynomials, a row vector of return value corresponds to each piecewise polynomial
      • integrate

        public double integrate​(PiecewisePolynomialResult pp,
                                double initialKey,
                                double xKey)
        Integration.
        Parameters:
        pp - the PiecewisePolynomialResult
        initialKey - the initial key
        xKey - the key
        Returns:
        the integral of piecewise polynomial between initialKey and xKey
      • integrate

        public DoubleArray integrate​(PiecewisePolynomialResult pp,
                                     double initialKey,
                                     double[] xKeys)
        Integration.
        Parameters:
        pp - the PiecewisePolynomialResult
        initialKey - the initial key
        xKeys - the keys
        Returns:
        the integral of piecewise polynomial between initialKey and xKeys
      • evaluateAndDifferentiate

        public ValueDerivatives evaluateAndDifferentiate​(PiecewisePolynomialResult pp,
                                                         double xKey)
        Evaluates the function and its first derivative.

        The dimension of PiecewisePolynomialResult must be 1.

        Parameters:
        pp - the PiecewisePolynomialResult
        xKey - the key
        Returns:
        the value and derivative
      • getValue

        protected double getValue​(DoubleArray coefs,
                                  double x,
                                  double leftknot)
        Parameters:
        coefs - {a_n,a_{n-1},...} of f(x) = a_n x^{n} + a_{n-1} x^{n-1} + ....
        x - the x-value
        leftknot - the knot specifying underlying interpolation function
        Returns:
        the value of the underlying interpolation function at the value of x
      • getValue

        protected double getValue​(double[] coefs,
                                  double x,
                                  double leftknot)
        Parameters:
        coefs - {a_n,a_{n-1},...} of f(x) = a_n x^{n} + a_{n-1} x^{n-1} + ....
        x - the x-value
        leftknot - the knot specifying underlying interpolation function
        Returns:
        the value of the underlying interpolation function at the value of x