Class Polynomial<E>
java.lang.Object
dk.jonaslindstrom.ruffini.polynomials.elements.Polynomial<E>
- All Implemented Interfaces:
java.util.function.BiFunction<E,
Ring<E>, E>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPolynomial
(int degree, java.util.function.IntFunction<E> populator) Polynomial
(Vector<E> coefficients, Ring<E> ring) Polynomial
(Polynomial<E> p) Polynomial
(Collection<Integer> nonZero, java.util.function.IntFunction<E> populator) -
Method Summary
Modifier and TypeMethodDescriptionbatchApply
(List<E> input, PolynomialRingOverRing<E> ring) Evaluate this polynomial for all inputs in the given list.static <T> Polynomial<T>
constant
(T constant) int
degree()
differentiate
(Ring<E> ring) boolean
void
void
forEachInParallel
(java.util.function.BiConsumer<Integer, E> consumer) getCoefficient
(int i) Get the i'th coefficient or, if it is not present,null
.int
hashCode()
<X> Polynomial<X>
mapCoefficients
(java.util.function.Function<E, X> converter) static <T> Polynomial<T>
monomial
(T coefficient, int degree) static <T> Polynomial<T>
of
(T... coefficients) Construct a new polynomial with the given coefficients.removeTerms
(java.util.function.Predicate<E> predicate) reverse()
toString()
Return the coefficients of this polynomial as a vector.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen
-
Constructor Details
-
Polynomial
-
Polynomial
-
Polynomial
-
Polynomial
-
-
Method Details
-
constant
-
monomial
-
of
Construct a new polynomial with the given coefficients. The constant coefficient is first, the linear is second etc. -
forEach
-
forEachInParallel
-
mapCoefficients
-
removeTerms
-
scale
-
apply
-
batchApply
Evaluate this polynomial for all inputs in the given list. -
degree
public int degree() -
getCoefficient
Get the i'th coefficient or, if it is not present,null
. -
vector
Return the coefficients of this polynomial as a vector. The coefficients (of degree less than the degree of the polynomial) that are not present will be replaced by the given zero value. -
differentiate
-
reverse
-
toString
-
toString
-
toString
-
equals
-
hashCode
public int hashCode() -
getConstant
-