Polynomial

class Polynomial<out T>(coefficients: List<T>)

Polynomial coefficients model without fixation on specific context they are applied to.

Parameters

coefficients

constant is the leftmost coefficient.

Constructors

Polynomial
Link copied to clipboard
fun <out T> Polynomial(coefficients: List<T>)
constant is the leftmost coefficient.

Functions

toString
Link copied to clipboard
open override fun toString(): String

Properties

coefficients
Link copied to clipboard
val coefficients: List<T>
constant is the leftmost coefficient.

Extensions

asFunction
Link copied to clipboard
fun <T, C : Ring<T>> Polynomial<T>.asFunction(ring: C): (T) -> T
Represent the polynomial as a regular context-less function.
differentiate
Link copied to clipboard
fun <T, A : Ring<T>, NumericAlgebra<T>> Polynomial<T>.differentiate(algebra: A): Polynomial<T>
Create a polynomial witch represents differentiated version of this polynomial
integrate
Link copied to clipboard
fun <T, A : Field<T>, NumericAlgebra<T>> Polynomial<T>.integrate(algebra: A): Polynomial<T>
Create a polynomial witch represents indefinite integral version of this polynomial
fun <T : Comparable<T>> Polynomial<T>.integrate(algebra: Field<T>, range: ClosedRange<T>): T
Compute a definite integral of a given polynomial in a range
value
Link copied to clipboard
fun Polynomial<Double>.value(arg: Double): Double
Evaluates the value of the given double polynomial for given double argument.
fun <T, C : Ring<T>> Polynomial<T>.value(ring: C, arg: T): T
Evaluates the value of the given polynomial for given argument.

Sources

common source
Link copied to clipboard