PiecewisePolynomial

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

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

Functions

findPiece
Link copied to clipboard
abstract override fun findPiece(arg: T): Polynomial<T>?
Returns the appropriate sub-function for given piece key.

Properties

pieces
Link copied to clipboard
abstract val pieces: Collection<Pair<ClosedRange<T>, Polynomial<T>>>
An ordered list of range-polynomial pairs.

Extensions

asFunction
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.
integrate
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
value
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

common source
Link copied to clipboard