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

Link copied to clipboard
fun <out T> Polynomial(coefficients: List<T>)

Functions

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

Properties

Link copied to clipboard
val coefficients: List<T>

Extensions

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.

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

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

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. https://en.wikipedia.org/wiki/Horner%27s_method

Sources

Link copied to clipboard