Polynomial

class Polynomial<T : Any>(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 <T : Any> Polynomial(coefficients: List<T>)
constant is the leftmost coefficient.

Properties

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

Extensions

asFunction
Link copied to clipboard
fun <T : Any, C : Ring<T>> Polynomial<T>.asFunction(ring: C): (T) -> T
Represent the polynomial as a regular context-less function.
value
Link copied to clipboard
fun Polynomial<Double>.value(): Double
Evaluates the value of the given double polynomial for given double argument.
fun <T : Any, C : Ring<T>> Polynomial<T>.value(ring: C, arg: T): T
Evaluates the value of the given polynomial for given argument.