Package space.kscience.kmath.functions

Types

MultivariateFunction
Link copied to clipboard
typealias MultivariateFunction<T> = (Buffer<T>) -> T
Piecewise
Link copied to clipboard
fun fun interface Piecewise<in T, out R>
Represents piecewise-defined function.
PiecewiseBuilder
Link copied to clipboard
class PiecewiseBuilder<T : Comparable<T>>(delimiter: T)
A Piecewise builder where all the pieces are ordered by the Comparable type instances.
PiecewisePolynomial
Link copied to clipboard
interface PiecewisePolynomial<T : Comparable<T>> : Piecewise<T, Polynomial<T>>
Represents piecewise-defined function where all the sub-functions are polynomials.
Polynomial
Link copied to clipboard
class Polynomial<out T>(coefficients: List<T>)
Polynomial coefficients model without fixation on specific context they are applied to.
PolynomialSpace
Link copied to clipboard
class PolynomialSpace<T, C : Ring<T>, ScaleOperations<T>>(ring: C) : Group<Polynomial<T>> , ScaleOperations<Polynomial<T>>
Space of polynomials.
UnivariateFunction
Link copied to clipboard
typealias UnivariateFunction<T> = (T) -> T

Functions

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, C : Ring<T>> Polynomial<T>.asFunction(ring: C): (T) -> T
Represent the polynomial as a regular context-less function.
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.
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
PiecewisePolynomial
Link copied to clipboard
@PerformancePitfall(message = findPiece method of resulting piecewise is slow)
fun <T : Comparable<T>> PiecewisePolynomial(pieces: Collection<Pair<ClosedRange<T>, Polynomial<T>>>): PiecewisePolynomial<T>
A generic piecewise without constraints on how pieces are placed
fun <T : Comparable<T>> PiecewisePolynomial(startingPoint: T, builder: PiecewiseBuilder<T>.() -> Unit): PiecewisePolynomial<T>
A builder for PiecewisePolynomial
Polynomial
Link copied to clipboard
inline fun <T, C : Ring<T>, ScaleOperations<T>, R> C.polynomial(block: PolynomialSpace<T, C>.() -> R): R
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 : 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.
fun <T, C : Ring<T>> Polynomial<T>.value(ring: C, arg: T): T
Evaluates the value of the given polynomial for given argument.