public class RealPolynomialFunction1D extends Object implements DoubleFunction1D
| Constructor and Description |
|---|
RealPolynomialFunction1D(double... coefficients)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
RealPolynomialFunction1D |
add(double a)
Adds a constant to the polynomial (equivalent to adding the value to the constant
term of the polynomial).
|
DoubleFunction1D |
add(DoubleFunction1D f)
Adds a function to the polynomial.
|
double |
applyAsDouble(double x) |
RealPolynomialFunction1D |
derivative()
Returns the derivative of this polynomial (also a polynomial), where
$$
\begin{align*}
P'(x) = a_1 + 2 a_2 x + 3 a_3 x^2 + 4 a_4 x^3 + \dots + n a_n x^{n-1}
\end{align*}
$$.
|
RealPolynomialFunction1D |
divide(double a)
Divides the polynomial by a constant value (equivalent to dividing each coefficient by this value).
|
boolean |
equals(Object obj) |
double[] |
getCoefficients()
Gets the coefficients of this polynomial.
|
int |
hashCode() |
RealPolynomialFunction1D |
multiply(double a)
Multiplies the polynomial by a constant value (equivalent to multiplying each
coefficient by this value).
|
DoubleFunction1D |
multiply(DoubleFunction1D f)
Multiplies the polynomial by a function.
|
RealPolynomialFunction1D |
subtract(double a)
Subtracts a constant from the polynomial (equivalent to subtracting the value from the
constant term of the polynomial).
|
DoubleFunction1D |
subtract(DoubleFunction1D f)
Subtracts a function from the polynomial.
|
RealPolynomialFunction1D |
toMonic()
Converts the polynomial to its monic form.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitderivative, divide, fromandThen, compose, identitypublic RealPolynomialFunction1D(double... coefficients)
coefficients - the array of coefficients, not null or emptypublic double applyAsDouble(double x)
applyAsDouble in interface DoubleUnaryOperatorpublic double[] getCoefficients()
public DoubleFunction1D add(DoubleFunction1D f)
RealPolynomialFunction1D then the addition takes
place as in DoubleFunction1D, otherwise the result will also be a polynomial.add in interface DoubleFunction1Df - the function to addpublic RealPolynomialFunction1D add(double a)
add in interface DoubleFunction1Da - the value to addpublic RealPolynomialFunction1D derivative()
derivative in interface DoubleFunction1Dpublic RealPolynomialFunction1D divide(double a)
divide in interface DoubleFunction1Da - the divisorpublic DoubleFunction1D multiply(DoubleFunction1D f)
RealPolynomialFunction1D then the multiplication takes
place as in DoubleFunction1D, otherwise the result will also be a polynomial.multiply in interface DoubleFunction1Df - the function by which to multiplypublic RealPolynomialFunction1D multiply(double a)
multiply in interface DoubleFunction1Da - the multiplicatorpublic DoubleFunction1D subtract(DoubleFunction1D f)
If the function is not a RealPolynomialFunction1D then the subtract takes place
as in DoubleFunction1D, otherwise the result will also be a polynomial.
subtract in interface DoubleFunction1Df - the function to subtractpublic RealPolynomialFunction1D subtract(double a)
subtract in interface DoubleFunction1Da - the value to addpublic RealPolynomialFunction1D toMonic()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.