Documentation of 'umontreal.iro.lecuyer.functions.Polynomial' Java class
Polynomial
umontreal.iro.lecuyer.functions

Class Polynomial

    • Constructor Summary

      Constructors 
      Constructor and Description
      Polynomial(double... coeff)
      Constructs a new polynomial with coefficients coeff.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Polynomial clone() 
      double derivative(double x)
      Computes (or estimates) the first derivative of the function at point x.
      double derivative(double x, int n)
      Computes (or estimates) the nth derivative of the function at point x.
      Polynomial derivativePolynomial(int n)
      Returns a polynomial corresponding to the nth derivative of this polynomial.
      double evaluate(double x)
      Returns the value of the function evaluated at x.
      double getCoefficient(int i)
      Returns the ith coefficient of the polynomial.
      double[] getCoefficients()
      Returns an array containing the coefficients of the polynomial.
      int getDegree()
      Returns the degree of this polynomial.
      double integral(double a, double b)
      Computes (or estimates) the integral of the function over the interval [a, b].
      Polynomial integralPolynomial(double c)
      Returns a polynomial representing the integral of this polynomial.
      void setCoefficients(double... coeff)
      Sets the array of coefficients of this polynomial to coeff.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • Polynomial

        public Polynomial(double... coeff)
        Constructs a new polynomial with coefficients coeff. The value of coeff[i] in this array corresponds to ci.
        Parameters:
        coeff - the coefficients of the polynomial.
        Throws:
        java.lang.NullPointerException - if coeff is null.
        java.lang.IllegalArgumentException - if the length of coeff is 0.
    • Method Detail

      • getDegree

        public int getDegree()
        Returns the degree of this polynomial.
        Returns:
        the degree of this polynomial.
      • getCoefficients

        public double[] getCoefficients()
        Returns an array containing the coefficients of the polynomial.
        Returns:
        the array of coefficients.
      • getCoefficient

        public double getCoefficient(int i)
        Returns the ith coefficient of the polynomial.
        Returns:
        the array of coefficients.
      • setCoefficients

        public void setCoefficients(double... coeff)
        Sets the array of coefficients of this polynomial to coeff.
        Parameters:
        coeff - the new array of coefficients.
        Throws:
        java.lang.NullPointerException - if coeff is null.
        java.lang.IllegalArgumentException - if the length of coeff is 0.
      • evaluate

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

        public double derivative(double x,
                                 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:
        x - the point to evaluate the derivate to.
        n - the order of the derivative.
        Returns:
        the resulting derivative.
      • derivativePolynomial

        public Polynomial derivativePolynomial(int n)
        Returns a polynomial corresponding to the nth derivative of this polynomial.
        Parameters:
        n - the degree of the derivative.
        Returns:
        the derivative.
      • 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.
      • integralPolynomial

        public Polynomial integralPolynomial(double c)
        Returns a polynomial representing the integral of this polynomial. This integral is of the form

        p(x)dx = c + c0x + $\displaystyle {\frac{{c_1 x^2}}{2}}$ + ... + $\displaystyle {\frac{{c_n x^{n+1}}}{{n+1}}}$,

        where c is a user-defined constant.
        Parameters:
        c - the constant for the integral.
        Returns:
        the polynomial representing the integral.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clone

        public Polynomial clone()
        Overrides:
        clone in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.