Deprecated
as a consequence of DifferentiableUnivariateFunction being deprecated. See corresponding docs for further information.
Horner's Method is used to evaluate the function.
| Modifier and Type | Class and Description |
|---|---|
| public static class | PolynomialFunction.
Dedicated parametric polynomial class. |
| Modifier and Type | Field and Description |
|---|---|
| private final double[] | coefficients
The coefficients of the polynomial, ordered by degree -- i.e., coefficients[0] is the constant term and coefficients[n] is the coefficient of x^n where n is the degree of the polynomial. |
| private static final long | serialVersionUID
Serialization identifier |
| Access | Constructor and Description |
|---|---|
| public | PolynomialFunction(double[]
Polynomial coefficients. c)Construct a polynomial with the given coefficients. |
| Modifier and Type | Method and Description |
|---|---|
| public PolynomialFunction | Returns: a new polynomial which is the sum of the instance andp.Polynomial to add. p)
Deprecated
as a consequence of
PolynomialFunction being deprecated.
Add a polynomial to the instance. |
| public int | |
| public UnivariateFunction | Returns: the derivative function.Implements org. Returns the derivative as a |
| protected static double[] | Returns: the coefficients of the derivative ornull if coefficients has length 1.Coefficients of the polynomial to differentiate. coefficients)Returns the coefficients of the derivative of the polynomial with the given coefficients. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| protected static double | Returns: the value of the polynomial.Coefficients of the polynomial to evaluate. coefficients, double Input value. argument)Uses Horner's Method to evaluate the polynomial with the given coefficients at the argument. |
| public double[] | Returns: a fresh copy of the coefficients array.Returns a copy of the coefficients array. |
| public int | |
| public PolynomialFunction | Returns: a new polynomial equal to this timespPolynomial to multiply by. p)
Deprecated
as a consequence of
PolynomialFunction being deprecated.
Multiply the instance by a polynomial. |
| public PolynomialFunction | Returns: a new polynomial with all coefficients negated
Deprecated
as a consequence of
PolynomialFunction being deprecated.
Negate the instance. |
| public PolynomialFunction | Returns: the derivative polynomial.
Deprecated
as a consequence of
PolynomialFunction being deprecated.
Returns the derivative as a |
| public PolynomialFunction | Returns: a new polynomial which is the instance minusp.Polynomial to subtract. p)
Deprecated
as a consequence of
PolynomialFunction being deprecated.
Subtract a polynomial from the instance. |
| public String | Returns: a string representation of the polynomial.Overrides java. Returns a string representation of the polynomial. |
| private static String | Returns: a string representation ofcoeff.Coefficient. coeff)Creates a string representing a coefficient, removing ".0" endings. |
| public double | Returns: the value of the polynomial at the given point.Argument for which the function value should be computed. x)Implements org. Compute the value of the function for the given argument. |
| public DerivativeStructure | value(final DerivativeStructure
function input value t)Implements org. Simple mathematical function. |
| coefficients | back to summary |
|---|---|
| private final double[] coefficients The coefficients of the polynomial, ordered by degree -- i.e., coefficients[0] is the constant term and coefficients[n] is the coefficient of x^n where n is the degree of the polynomial. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization identifier | |
| PolynomialFunction | back to summary |
|---|---|
| public PolynomialFunction(double[] c) throws NullArgumentException, NoDataException Construct a polynomial with the given coefficients. The first element of the coefficients array is the constant term. Higher degree coefficients follow in sequence. The degree of the resulting polynomial is the index of the last non-null element of the array, or 0 if all elements are null. The constructor makes a copy of the input array and assigns the copy to the coefficients property.
| |
| add | back to summary |
|---|---|
| public PolynomialFunction add(final PolynomialFunction p)
Deprecated as a consequence of Add a polynomial to the instance.
| |
| degree | back to summary |
|---|---|
| public int degree() Returns the degree of the polynomial.
| |
| derivative | back to summary |
|---|---|
| public UnivariateFunction derivative() Implements org. Returns the derivative as a
| |
| differentiate | back to summary |
|---|---|
| protected static double[] differentiate(double[] coefficients) throws NullArgumentException, NoDataException Returns the coefficients of the derivative of the polynomial with the given coefficients.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| evaluate | back to summary |
|---|---|
| protected static double evaluate(double[] coefficients, double argument) throws NullArgumentException, NoDataException Uses Horner's Method to evaluate the polynomial with the given coefficients at the argument.
| |
| getCoefficients | back to summary |
|---|---|
| public double[] getCoefficients() Returns a copy of the coefficients array. Changes made to the returned copy will not affect the coefficients of the polynomial.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| multiply | back to summary |
|---|---|
| public PolynomialFunction multiply(final PolynomialFunction p)
Deprecated as a consequence of Multiply the instance by a polynomial.
| |
| negate | back to summary |
|---|---|
| public PolynomialFunction negate()
Deprecated as a consequence of Negate the instance.
| |
| polynomialDerivative | back to summary |
|---|---|
| public PolynomialFunction polynomialDerivative()
Deprecated as a consequence of Returns the derivative as a
| |
| subtract | back to summary |
|---|---|
| public PolynomialFunction subtract(final PolynomialFunction p)
Deprecated as a consequence of Subtract a polynomial from the instance.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of the polynomial. The representation is user oriented. Terms are displayed lowest
degrees first. The multiplications signs, coefficients equals to
one and null terms are not displayed (except if the polynomial is 0,
in which case the 0 constant term is displayed). Addition of terms
with negative coefficients are replaced by subtraction of terms
with positive coefficients except for the first displayed term
(i.e. we display | |
| toString | back to summary |
|---|---|
| private static String toString(double coeff) Creates a string representing a coefficient, removing ".0" endings.
| |
| value | back to summary |
|---|---|
| public double value(double x) Implements org. Compute the value of the function for the given argument. The value returned is
| |
| value | back to summary |
|---|---|
| public DerivativeStructure value(final DerivativeStructure t) throws NullArgumentException, NoDataException Implements org. Doc from org. Simple mathematical function.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public double[] | gradient(double
Point for which the function value should be computed. x, double... Function parameters. parameters)Implements org. Compute the gradient of the function with respect to its parameters. |
| public double | value(final double
Point for which the function value should be computed. x, final double... Function parameters. parameters)Implements org. Compute the value of the function. |
| Parametric | back to summary |
|---|---|
| public Parametric() | |
| gradient | back to summary |
|---|---|
| public double[] gradient(double x, double... parameters) Implements org. Doc from org. Compute the gradient of the function with respect to its parameters.
| |
| value | back to summary |
|---|---|
| public double value(final double x, final double... parameters) throws NoDataException Implements org. Doc from org. Compute the value of the function.
| |