Interval

class Interval(xLower: Double = Double.NEGATIVE_INFINITY, xUpper: Double = Double.POSITIVE_INFINITY)

Can be used to represent confidence intervals. Intervals between two real numbers where the lower limit must be less than or equal to the upper limit. The interval is inclusive of both end points.

Author

rossetti

Parameters

xLower

the lower limit, must be less than or equal to xUpper

xUpper

the upper limit

Constructors

Link copied to clipboard
constructor(xLower: Int, xUpper: Int)
constructor(xLower: Double = Double.NEGATIVE_INFINITY, xUpper: Double = Double.POSITIVE_INFINITY)

Properties

Link copied to clipboard

Half of the width of the interval

Link copied to clipboard
Link copied to clipboard

The mid-point between the upper and lower limits

Link copied to clipboard
Link copied to clipboard

The width of the interval

Functions

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

operator fun contains(interval: Interval): Boolean

Checks if the supplied interval is contained within this interval

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

A new instance with the same interval settings.

Link copied to clipboard

Returns a new interval where the end points have been rounded down (lower limit) and rounded up (upper limit) to integer valued doubles.

Link copied to clipboard
fun stepPoints(numSteps: Int): DoubleArray

Creates an array that holds points from the interval all with the same distance between the points with the first point starting at the lower limit and stepping up towards the upper limit based on the number of steps.

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