Package space.kscience.kmath.integration

Types

Link copied to clipboard
object DoubleSimpsonIntegrator : Integrator<UnivariateIntegrand<Double>>

Use double pass Simpson rule integration with a fixed number of points. Requires UnivariateIntegrandRanges or IntegrationRange and IntegrandMaxCalls.

Link copied to clipboard

A simplified double-based spline-interpolation-based analytic integration

Link copied to clipboard
class GaussIntegrator<T : Any>(algebra: Field<T>) : Integrator<UnivariateIntegrand<T>>

A simple one-pass integrator based on Gauss rule Following integrand features are accepted:

Link copied to clipboard
interface GaussIntegratorRuleFactory : IntegrandFeature
Link copied to clipboard
object GaussLegendreRuleFactory : GaussIntegratorRuleFactory

Gauss integrator rule based ont Legendre polynomials. All rules are normalized to

Link copied to clipboard
interface Integrand : Featured<IntegrandFeature>
Link copied to clipboard
class IntegrandAbsoluteAccuracy(accuracy: Double) : IntegrandFeature
Link copied to clipboard
class IntegrandCallsPerformed(calls: Int) : IntegrandFeature
Link copied to clipboard
interface IntegrandFeature : Feature<IntegrandFeature>
Link copied to clipboard
class IntegrandIterationsRange(range: IntRange) : IntegrandFeature
Link copied to clipboard
class IntegrandMaxCalls(maxCalls: Int) : IntegrandFeature
Link copied to clipboard
class IntegrandRelativeAccuracy(accuracy: Double) : IntegrandFeature
Link copied to clipboard
class IntegrandValue<out T : Any>(value: T) : IntegrandFeature
Link copied to clipboard
class IntegrationRange(range: ClosedRange<Double>) : IntegrandFeature
Link copied to clipboard
interface Integrator<I : Integrand>

A general interface for all integrators.

Link copied to clipboard
class MultivariateIntegrand<T : Any> : Integrand
Link copied to clipboard
class SimpsonIntegrator<T : Any>(algebra: Field<T>) : Integrator<UnivariateIntegrand<T>>

Use double pass Simpson rule integration with a fixed number of points. Requires UnivariateIntegrandRanges or IntegrationRange and IntegrandMaxCalls.

Link copied to clipboard
class SplineIntegrator<T : Comparable<T>>(algebra: Field<T>, bufferFactory: MutableBufferFactory<T>) : Integrator<UnivariateIntegrand<T>>

A generic spline-interpolation-based analytic integration

Link copied to clipboard
class UnivariateIntegrand<T> : Integrand
Link copied to clipboard
class UnivariateIntegrandRanges(ranges: List<Pair<ClosedRange<Double>, Int>>) : IntegrandFeature

Set of univariate integration ranges. First components correspond to the ranges themselves, second components to number of integration nodes per range.

Link copied to clipboard
class UnivariateIntegrationNodes(nodes: Buffer<Double>) : IntegrandFeature
Link copied to clipboard
typealias UnivariateIntegrator<T> = Integrator<UnivariateIntegrand<T>>

Functions

Link copied to clipboard
fun GaussIntegratorRuleFactory.build(numPoints: Int, range: ClosedRange<Double>): Pair<Buffer<Double>, Buffer<Double>>

Create an integration rule by scaling existing normalized rule

Link copied to clipboard
inline fun <T : IntegrandFeature> Integrand.getFeature(): T?
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

fun <T : Any> UnivariateIntegrator<T>.integrate(vararg features: IntegrandFeature, function: (Double) -> T): UnivariateIntegrand<T>

A shortcut method to integrate a function with additional features. Range must be provided in features. The function is placed in the end position to allow passing a lambda.

fun <T : Any> UnivariateIntegrator<T>.integrate(range: ClosedRange<Double>, vararg features: IntegrandFeature, function: (Double) -> T): UnivariateIntegrand<T>

A shortcut method to integrate a function in range with additional features. The function is placed in the end position to allow passing a lambda.

fun <T : Any> UnivariateIntegrator<T>.integrate(range: ClosedRange<Double>, featureBuilder: MutableList<IntegrandFeature>.() -> Unit = {}, function: (Double) -> T): UnivariateIntegrand<T>

A shortcut method to integrate a function in range with additional features. The function is placed in the end position to allow passing a lambda.

fun <T : Any> GaussIntegrator<T>.integrate(range: ClosedRange<Double>, order: Int = 10, intervals: Int = 10, vararg features: IntegrandFeature, function: (Double) -> T): UnivariateIntegrand<T>

Integrate using intervals segments with Gauss-Legendre rule of order order.

Link copied to clipboard
fun <T : Any> MultivariateIntegrand(vararg features: IntegrandFeature, function: (Point<T>) -> T): MultivariateIntegrand<T>
Link copied to clipboard
fun <T : Any> UnivariateIntegrand(function: (Double) -> T, vararg features: IntegrandFeature): UnivariateIntegrand<T>

Properties

Link copied to clipboard
val Integrand.calls: Int
Link copied to clipboard
val <T : Any> Field<T>.gaussIntegrator: GaussIntegrator<T>

Create a Gauss integrator for this field. By default, uses Legendre rule to compute points and weights. Custom rules could be provided by GaussIntegratorRuleFactory feature.

Link copied to clipboard
val <T : Any> Field<T>.simpsonIntegrator: SimpsonIntegrator<T>
Link copied to clipboard
val DoubleField.simpsonIntegrator: DoubleSimpsonIntegrator
Link copied to clipboard
Link copied to clipboard
val <T : Any> MultivariateIntegrand<T>.value: T?
Link copied to clipboard
val <T : Any> UnivariateIntegrand<T>.value: T

Value of the integrand or error

Link copied to clipboard
val <T : Any> UnivariateIntegrand<T>.valueOrNull: T?

Value of the integrand if it is present or null