Package-level declarations

Types

Link copied to clipboard
class BisectionRootFinder(func: FunctionIfc, interval: Interval, initialPoint: Double = (interval.lowerLimit + interval.upperLimit) / 2.0, maxIter: Int = 100, desiredPrec: Double = KSLMath.defaultNumericalPrecision) : RootFinder
Link copied to clipboard
abstract class BoundedIterativeProcess<T>(func: FunctionIfc, interval: Interval, initialPoint: Double = (interval.lowerLimit + interval.upperLimit) / 2.0, maxIterations: Int, desiredPrecision: Double = 1.0E-4) : IterativeProcess<T>

Abstract base for root-finding algorithms operating within a bounded search interval. Parallel branch to RootFinder directly under IterativeProcess. Does not impose the sign-change (bracketing) constraint — concrete subclasses that require it assert it in their own init blocks via RootFinder.Companion.hasRoot.

Link copied to clipboard
class GridEnumerator(theFunction: FunctionIfc)
Link copied to clipboard
abstract class RootFinder(aFunction: FunctionIfc, anInterval: Interval, anInitialPoint: Double = (anInterval.lowerLimit + anInterval.upperLimit) / 2.0, maxIter: Int = 100, desiredPrec: Double = KSLMath.defaultNumericalPrecision) : FunctionalIterator
Link copied to clipboard

Default implementation. Delegated to by StochasticApproximationRootFinder.

Link copied to clipboard

Promises the ability to emit an SAStatus at each process lifecycle transition. Fires unconditionally — at most four times per run with negligible allocation cost.

Link copied to clipboard

Represents the distinct lifecycle states of a StochasticApproximationRootFinder run. Emitted through SALifeCycleEmitterIfc.lifeCycleEmitter at each transition so that subscribers can branch on outcome type without inspecting string messages.

Link copied to clipboard
data class SAStep(val x: Double, val fOfX: Double, val rmSeries: Double, val rsc: Double, val stoppingCriteria: Double, val iterationCount: Int)

Immutable snapshot of the SA algorithm state at the completion of one iteration. Emitted through SAStepEmitterIfc.stepEmitter and optionally accumulated via StochasticApproximationRootFinder.saveSteps. Safe to store, share, or pass across threads without mutation risk.

Link copied to clipboard

Default implementation. Delegated to by StochasticApproximationRootFinder.

Link copied to clipboard

Promises the ability to emit an SAStep snapshot after each completed iteration. Emission is gated by StochasticApproximationRootFinder.snapShotFrequency and Emitter.isObserved. When no subscriber is attached and saveSteps is false, no SAStep object is allocated for that iteration.

Link copied to clipboard
class StochasticApproximationRootFinder(func: FunctionIfc, interval: Interval, initialPoint: Double = (interval.lowerLimit + interval.upperLimit) / 2.0, scaleFactor: Double = DEFAULT_SCALE_FACTOR, alpha: Double = DEFAULT_ALPHA, maxIterations: Int = DEFAULT_MAX_ITER, desiredPrecision: Double = DEFAULT_PRECISION, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider) : BoundedIterativeProcess<SAStep> , SAStepEmitterIfc, SALifeCycleEmitterIfc

Implements the Robbins-Monroe stochastic approximation root-finding algorithm with Kesten acceleration and an exponentially weighted stopping criterion.

Functions

Link copied to clipboard
fun main()
fun main()