PiecewisePolynomial

interface PiecewisePolynomial<T : Comparable<T>> : Piecewise<T, Polynomial<T>>

Represents piecewise-defined function where all the sub-functions are polynomials.

Functions

Link copied to clipboard
abstract override fun findPiece(arg: T): Polynomial<T>?

Returns the appropriate sub-function for given piece key.

Properties

Link copied to clipboard
abstract val pieces: Collection<Pair<ClosedRange<T>, Polynomial<T>>>

An ordered list of range-polynomial pairs. The list does not in general guarantee that there are no "holes" in it.

Extensions

Link copied to clipboard
fun <T : Comparable<T>, C : Ring<T>> PiecewisePolynomial<T>.asFunction(ring: C): (T) -> T?

Convert this polynomial to a function returning nullable value (null if argument is outside piecewise range).

fun <T : Comparable<T>, C : Ring<T>> PiecewisePolynomial<T>.asFunction(ring: C, defaultValue: T): (T) -> T

Convert this polynomial to a function using defaultValue for arguments outside the piecewise range.

Link copied to clipboard
fun <T : Comparable<T>> PiecewisePolynomial<T>.integrate(algebra: Field<T>): PiecewisePolynomial<T>

Compute analytical indefinite integral of this PiecewisePolynomial, keeping all intervals intact

fun <T : Comparable<T>> PiecewisePolynomial<T>.integrate(algebra: Field<T>, range: ClosedRange<T>): T

Compute definite integral of given PiecewisePolynomial piece by piece in a given range Requires UnivariateIntegrationNodes or IntegrationRange and IntegrandMaxCalls

Link copied to clipboard
fun <T : Comparable<T>, C : Ring<T>> PiecewisePolynomial<T>.value(ring: C, arg: T): T?

Return a value of polynomial function with given ring a given arg or null if argument is outside piecewise definition.

Sources

Link copied to clipboard