Header menu logo Deedle

Array Module

This module contains additional functions for working with arrays. `Deedle.Internals` is opened, it extends the standard `Array` module.

Functions and values

Function or value Description

binarySearchNearestGreater key comparer inclusive array

Full Usage: binarySearchNearestGreater key comparer inclusive array

Parameters:
Returns: int option

Returns the index of 'key' or the index of immediately following value. If the specified key is greater than all keys in the array, None is returned. When 'inclusive' is false, the function returns the index of strictry greater value. Note that the function expects that the array contains distinct values (which is fine because LinearIndex does not support duplicate keys)

key : 'T
comparer : IComparer<'T>
inclusive : bool
array : ReadOnlyCollection<'T>
Returns: int option

binarySearchNearestSmaller key comparer inclusive array

Full Usage: binarySearchNearestSmaller key comparer inclusive array

Parameters:
Returns: int option

Returns the index of 'key' or the index of immediately preceeding value. If the specified key is smaller than all keys in the array, None is returned. When 'inclusive' is false, the function returns the index of strictry smaller value. Note that the function expects that the array contains distinct values (which is fine because LinearIndex does not support duplicate keys)

key : 'T
comparer : IComparer<'T>
inclusive : bool
array : ReadOnlyCollection<'T>
Returns: int option

choosei f array

Full Usage: choosei f array

Parameters:
    f : int -> 'a -> 'b option
    array : 'a[]

Returns: 'b[]
Modifiers: inline
Type parameters: 'a, 'b

Returns a new array containing only the elements for which the specified function returns `Some`. The predicate is called with the index in the source array and the element.

f : int -> 'a -> 'b option
array : 'a[]
Returns: 'b[]

dropRange first last data

Full Usage: dropRange first last data

Parameters:
    first : int
    last : int
    data : 'T[]

Returns: 'T array
Modifiers: inline
Type parameters: 'T

Drop a specified range from a given array. The operation is inclusive on both sides. Given [ 1; 2; 3; 4 ] and indices (1, 2), the result is [ 1; 4 ]

first : int
last : int
data : 'T[]
Returns: 'T array

Type something to start searching.