Header menu logo FSharp.Stats

Interval<'a> Type

Represents an interval between two values of type 'a, which can be either inclusive or exclusive.

Union cases

Union case Description

Closed(intervalStart, intervalEnd)

Full Usage: Closed(intervalStart, intervalEnd)

Parameters:
    intervalStart : 'a - The start value of the interval
    intervalEnd : 'a - The end value of the interval

Represents a closed interval [start,end] that includes endpoints

intervalStart : 'a

The start value of the interval

intervalEnd : 'a

The end value of the interval

Empty

Full Usage: Empty

Represents an empty interval

LeftOpen(intervalStart, intervalEnd)

Full Usage: LeftOpen(intervalStart, intervalEnd)

Parameters:
    intervalStart : 'a - The start value of the interval
    intervalEnd : 'a - The end value of the interval

Represents an interval (start,end] that includes the right endpoint.

intervalStart : 'a

The start value of the interval

intervalEnd : 'a

The end value of the interval

Open(intervalStart, intervalEnd)

Full Usage: Open(intervalStart, intervalEnd)

Parameters:
    intervalStart : 'a - The start value of the interval
    intervalEnd : 'a - The end value of the interval

Represents the open interval (start,end).

intervalStart : 'a

The start value of the interval

intervalEnd : 'a

The end value of the interval

RightOpen(intervalStart, intervalEnd)

Full Usage: RightOpen(intervalStart, intervalEnd)

Parameters:
    intervalStart : 'a - The start value of the interval
    intervalEnd : 'a - The end value of the interval

Represents an interval [start,end) that includes the left endpoint.

intervalStart : 'a

The start value of the interval

intervalEnd : 'a

The end value of the interval

Instance members

Instance member Description

this.GetEnd

Full Usage: this.GetEnd

Returns: 'a
Modifiers: inline

Returns the end value of the interval

Returns: 'a
InvalidOperationException Thrown when the interval is empty
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the end value of the interval (7.0)  
 interval.GetEnd()
val interval: obj

this.GetStart

Full Usage: this.GetStart

Returns: 'a
Modifiers: inline

Returns the start value of the interval

Returns: 'a
InvalidOperationException Thrown when the interval is empty
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the start value of the interval (2.0)
 interval.GetStart()
val interval: obj

this.ToTuple

Full Usage: this.ToTuple

Returns: 'a * 'a
Modifiers: inline

Returns a tuple of the start and end values of the interval

Returns: 'a * 'a
InvalidOperationException Thrown when the interval is empty
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the start and end values of the interval (2.0, 7.0)
 interval.ToTuple()
val interval: obj

this.TryEnd

Full Usage: this.TryEnd

Returns: 'a option
Modifiers: inline

Returns an option containing the end value of the interval, if it exists

Returns: 'a option
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the end value of the interval Some(7.0)
 interval.TryEnd
val interval: obj

this.TryStart

Full Usage: this.TryStart

Returns: 'a option
Modifiers: inline

Returns an option containing the start value of the interval, if it exists

Returns: 'a option
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the start value of the interval Some(2.0)
 interval.TryStart
val interval: obj

this.TryToTuple

Full Usage: this.TryToTuple

Returns: ('a * 'a) option
Modifiers: inline

Returns an option containing a tuple of the start and end values of the interval, if they exist

Returns: ('a * 'a) option
Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Get the start and end values of the interval Some((2.0, 7.0))
 interval.TryToTuple()
val interval: obj

this.liesInInterval value

Full Usage: this.liesInInterval value

Parameters:
    value : 'a - The value to check for containment in the interval

Returns: bool True if the value is contained in the interval, false otherwise
Modifiers: inline

Checks if the given value lies in the interval or not.

value : 'a

The value to check for containment in the interval

Returns: bool

True if the value is contained in the interval, false otherwise

Example

 // Create a closed interval [2.0, 7.0]
 let interval = Interval.CreateClosed(2.0, 7.0)
 // Check if the value 5.0 lies in the interval (true)
 interval.liesInInterval 5.0
val interval: obj

Static members

Static member Description

Interval.CreateClosed(min, max)

Full Usage: Interval.CreateClosed(min, max)

Parameters:
    min : 'a - The start value of the interval
    max : 'a - The end value of the interval

Returns: Interval<'a> A closed interval
Modifiers: inline

Creates a closed interval [min,max]

min : 'a

The start value of the interval

max : 'a

The end value of the interval

Returns: Interval<'a>

A closed interval

Interval.CreateLeftOpen(min, max)

Full Usage: Interval.CreateLeftOpen(min, max)

Parameters:
    min : 'a - The start value of the interval
    max : 'a - The end value of the interval

Returns: Interval<'a> A left-open interval
Modifiers: inline

Creates a left-open interval (min,max]

min : 'a

The start value of the interval

max : 'a

The end value of the interval

Returns: Interval<'a>

A left-open interval

Interval.CreateOpen(min, max)

Full Usage: Interval.CreateOpen(min, max)

Parameters:
    min : 'a - The start value of the interval
    max : 'a - The end value of the interval

Returns: Interval<'a> An open interval
Modifiers: inline

Creates an open interval (min,max)

min : 'a

The start value of the interval

max : 'a

The end value of the interval

Returns: Interval<'a>

An open interval

Interval.CreateRightOpen(min, max)

Full Usage: Interval.CreateRightOpen(min, max)

Parameters:
    min : 'a - The start value of the interval
    max : 'a - The end value of the interval

Returns: Interval<'a> A right-open interval
Modifiers: inline

Creates a right-open interval [min,max)

min : 'a

The start value of the interval

max : 'a

The end value of the interval

Returns: Interval<'a>

A right-open interval

Interval.ofSeq source

Full Usage: Interval.ofSeq source

Parameters:
    source : 'a seq - The input sequence of values

Returns: Interval<'a> A closed interval containing the minimum and maximum values
Modifiers: inline

Creates an interval from a sequence of values

source : 'a seq

The input sequence of values

Returns: Interval<'a>

A closed interval containing the minimum and maximum values

Example

 // Get the interval of [5.0; 10.0; 7.0]
 Interval.ofSeq [5.0; 10.0; 7.0] // Closed(5.0,10.0)

Interval.ofSeqBy projection source

Full Usage: Interval.ofSeqBy projection source

Parameters:
    projection : 'a -> 'b - A function to project each element of the sequence to the desired type
    source : 'a seq - The input sequence of values

Returns: Interval<'a> A closed interval containing the minimum and maximum projected values
Modifiers: inline

Creates an interval from a sequence of values using a projection function

projection : 'a -> 'b

A function to project each element of the sequence to the desired type

source : 'a seq

The input sequence of values

Returns: Interval<'a>

A closed interval containing the minimum and maximum projected values

InvalidOperationException Thrown when the input sequence contains NaN values
Example

 // "hello" is a char seq whos interval is [e,o]
 Interval.ofSeqBy int "hello" // Closed('e','o')
Multiple items
val int: value: 'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int

Type something to start searching.