BisectionRootFinder

class BisectionRootFinder(func: FunctionIfc, interval: Interval, initialPoint: Double = (interval.lowerLimit + interval.upperLimit) / 2.0, maxIter: Int = 100, desiredPrec: Double = KSLMath.defaultNumericalPrecision) : RootFinder

Constructors

Link copied to clipboard
constructor(func: FunctionIfc, interval: Interval, initialPoint: Double = (interval.lowerLimit + interval.upperLimit) / 2.0, maxIter: Int = 100, desiredPrec: Double = KSLMath.defaultNumericalPrecision)

Properties

Link copied to clipboard

The achieved precision.

Link copied to clipboard

Desired precision.

Link copied to clipboard
Link copied to clipboard

The initial point for the search

Link copied to clipboard

The lower limit for the search interval

Link copied to clipboard

The upper limit for the search interval

Link copied to clipboard

Number of iterations performed.

Link copied to clipboard

Maximum allowed number of iterations.

Link copied to clipboard

Returns the result (assuming convergence has been attained).

Functions

Link copied to clipboard
operator fun contains(x: Double): Boolean

Checks to see if the supplied point is within the search interval

Link copied to clipboard
fun evaluate()

Performs the iterative process. Note: this method does not return anything Subclass must implement a method to get the result

Link copied to clipboard

Check to see if the result has been attained.

Link copied to clipboard
fun hasRoot(interval: Interval): Boolean
fun hasRoot(xLower: Double, xUpper: Double): Boolean

Returns true if the supplied interval contains a root

Link copied to clipboard
Link copied to clipboard
fun setUpSearch(aFunction: FunctionIfc, anInterval: Interval, anInitialPoint: Double = (anInterval.lowerLimit + anInterval.upperLimit) / 2.0)

The interval must have a root for the function and the initial point must be within the interval

Link copied to clipboard
open override fun toString(): String