public class UnivariatePolynomialFunction extends java.lang.Object implements DifferentiableFunction, IntegrableFunction, java.util.function.DoubleUnaryOperator
Constructor and Description |
---|
UnivariatePolynomialFunction(double[] coefficients) |
Modifier and Type | Method and Description |
---|---|
double |
applyAsDouble(double arg0) |
UnivariatePolynomialFunction |
derivative()
Takes the derivative of this function
|
boolean |
equals(java.lang.Object obj) |
double |
evaluate(double x)
Evaluates the function at the given x.
|
int |
hashCode() |
UnivariatePolynomialFunction |
integral()
Takes the indefinite integral of this function, letting the constant
value c be 0
|
UnivariatePolynomialFunction |
minus(UnivariatePolynomialFunction f)
Subtracts the provided function from this one
|
UnivariatePolynomialFunction |
opposite()
Reverses the sign of this function
|
UnivariatePolynomialFunction |
plus(UnivariatePolynomialFunction f)
Adds the provided function to this one
|
UnivariatePolynomialFunction |
times(UnivariatePolynomialFunction f)
Multiplies the given function with this one
|
java.lang.String |
toString() |
public UnivariatePolynomialFunction(double[] coefficients)
coefficients
- the coefficients of the polynomial, from the highest order
term to the lowestpublic double applyAsDouble(double arg0)
applyAsDouble
in interface java.util.function.DoubleUnaryOperator
public UnivariatePolynomialFunction derivative()
DifferentiableFunction
derivative
in interface DifferentiableFunction
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double evaluate(double x)
x
- the x to evaluate atpublic int hashCode()
hashCode
in class java.lang.Object
public UnivariatePolynomialFunction integral()
IntegrableFunction
integral
in interface IntegrableFunction
public UnivariatePolynomialFunction minus(UnivariatePolynomialFunction f)
f
- the function to subtract from thispublic UnivariatePolynomialFunction opposite()
public UnivariatePolynomialFunction plus(UnivariatePolynomialFunction f)
f
- the function to add to thispublic UnivariatePolynomialFunction times(UnivariatePolynomialFunction f)
f
- the function to multiply this bypublic java.lang.String toString()
toString
in class java.lang.Object