Array Routines
52 nodes
On this page 52
As Read Only
FunctionA read-only view of the array, for handing its contents on without letting the receiver change them.
AsReadOnly(array: T Array) -> ReadOnlyCollection<T>
ReadOnlyCollection<T> AsReadOnly(T[] array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to wrap; null throws System.ArgumentNullException. |
Returns
| result | ReadOnlyCollection<T> |
Remarks
The view is not a copy: changes made to the array afterwards show through it.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Binary Search
FunctionOverload 1 of 8
BinarySearch(array: T Array, value: T) -> Integer
int BinarySearch(T[] array, T value)
Finds a value in an array that is already sorted in ascending order, much faster than a front-to-back search on a large array.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The sorted array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for. |
Returns
| result | Integer |
Remarks
The result is only meaningful if the array is sorted by the same ordering; if several elements equal the value, any one of their positions may be returned. Elements must be comparable, otherwise System.InvalidOperationException is thrown.
Overload 2 of 8
BinarySearch -> Integer
array: T Array
value: T
comparer: IComparer<T>int BinarySearch(T[] array, T value, IComparer<T> comparer)
Finds a value in an array that is already sorted by the given comparer, much faster than a front-to-back search on a large array.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The sorted array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for. |
| comparer | IComparer<T> | — | The ordering the array is sorted by; null uses the elements' default ordering. |
Returns
| result | Integer |
Remarks
The result is only meaningful if the array is sorted by the same comparer; if several elements equal the value, any one of their positions may be returned.
Overload 3 of 8
BinarySearch -> Integer
array: Array
index: Integer
length: Integer
value: Anyint BinarySearch(
Array array,
int index,
int length,
object value)Finds a value within a sorted section of a one-dimensional array of any element type, using the elements' default ordering.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException. |
| index | Integer | — | The index where the section starts. |
| length | Integer | — | How many elements the section covers. |
| value | Any | — | The value to look for. |
Returns
| result | Integer |
Remarks
The section must be sorted in ascending order. A multidimensional array throws System.RankException; a negative index or length throws System.ArgumentOutOfRangeException, and a section running past the end throws System.ArgumentException.
Overload 4 of 8
BinarySearch -> Integer
array: T Array
index: Integer
length: Integer
value: T
comparer: IComparer<T>int BinarySearch(
T[] array,
int index,
int length,
T value,
IComparer<T> comparer)Finds a value within a section of an array, where that section is already sorted by the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| index | Integer | — | The index where the section starts. |
| length | Integer | — | How many elements the section covers. |
| value | T | — | The value to look for. |
| comparer | IComparer<T> | — | The ordering the section is sorted by; null uses the elements' default ordering. |
Returns
| result | Integer |
Remarks
A negative index or length throws System.ArgumentOutOfRangeException, and a section running past the end throws System.ArgumentException.
Overload 5 of 8
BinarySearch -> Integer
array: T Array
index: Integer
length: Integer
value: Tint BinarySearch(T[] array, int index, int length, T value)
Finds a value within a section of an array, where that section is already sorted in ascending order.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| index | Integer | — | The index where the section starts. |
| length | Integer | — | How many elements the section covers. |
| value | T | — | The value to look for. |
Returns
| result | Integer |
Remarks
A negative index or length throws System.ArgumentOutOfRangeException, and a section running past the end throws System.ArgumentException.
Overload 6 of 8
BinarySearch -> Integer
array: Array
value: Any
comparer: IComparerint BinarySearch(Array array, object value, IComparer comparer)
Finds a value in a sorted one-dimensional array of any element type, using the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The sorted one-dimensional array to search; null throws System.ArgumentNullException. |
| value | Any | — | The value to look for. |
| comparer | IComparer | — | The ordering the array is sorted by; null uses the elements' default ordering. |
Returns
| result | Integer |
Remarks
The array must be sorted by the same comparer. A multidimensional array throws System.RankException.
Overload 7 of 8
BinarySearch(array: Array, value: Any) -> Integer
int BinarySearch(Array array, object value)
Finds a value in a sorted one-dimensional array of any element type, using the elements' default ordering.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The sorted one-dimensional array to search; null throws System.ArgumentNullException. |
| value | Any | — | The value to look for. |
Returns
| result | Integer |
Remarks
The array must be sorted in ascending order. A multidimensional array throws System.RankException.
Overload 8 of 8
BinarySearch -> Integer
array: Array
index: Integer
length: Integer
value: Any
comparer: IComparerint BinarySearch(
Array array,
int index,
int length,
object value,
IComparer comparer)Finds a value within a section of a one-dimensional array of any element type, where that section is sorted by the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException. |
| index | Integer | — | The index where the section starts. |
| length | Integer | — | How many elements the section covers. |
| value | Any | — | The value to look for. |
| comparer | IComparer | — | The ordering the section is sorted by; null uses the elements' default ordering. |
Returns
| result | Integer |
Remarks
A multidimensional array throws System.RankException; a negative index or length throws System.ArgumentOutOfRangeException, and a section running past the end throws System.ArgumentException.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Clear
FunctionOverload 1 of 2
Clear(array: Array)
void Clear(Array array)
Resets every element of the array, in all dimensions, to its type's default: 0 for numbers, false for booleans, null for text and objects. The array keeps its size.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to clear in place; null throws System.ArgumentNullException. |
Overload 2 of 2
Clear(array: Array, index: Integer, length: Integer)
void Clear(Array array, int index, int length)
Resets a run of elements to their type's default (0, false or null), leaving the rest of the array untouched.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to clear in place; null throws System.ArgumentNullException. |
| index | Integer | — | The index of the first element to reset. |
| length | Integer | — | How many elements to reset. |
Remarks
An index below the array's lower bound, a negative length, or a run that goes past the end throws System.IndexOutOfRangeException.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Clone
FunctionA new array of the same type, shape and contents, so the copy can be changed without affecting the original.
Clone(array: Array) -> Any
object Clone(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to copy. |
Returns
| result | Any |
Remarks
The copy is shallow: for elements that are objects, both arrays refer to the same objects.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Constrained Copy
FunctionCopies a run of elements from one array into another all-or-nothing: if the copy cannot complete, the destination is left exactly as it was.
ConstrainedCopy
sourceArray: Array
sourceIndex: Integer
destinationArray: Array
destinationIndex: Integer
length: Integervoid ConstrainedCopy(
Array sourceArray,
int sourceIndex,
Array destinationArray,
int destinationIndex,
int length)Parameters
| name | type | default | description |
|---|---|---|---|
| sourceArray | Array | — | The array to copy from. |
| sourceIndex | Integer | — | The index in the source where copying starts. |
| destinationArray | Array | — | The array to copy into; it must have the same number of dimensions as the source. |
| destinationIndex | Integer | — | The index in the destination where the first copied element lands. |
| length | Integer | — | How many elements to copy; a run past the end of either array throws System.ArgumentException. |
Remarks
Unlike Copy, it does not convert between element types: the source element type must be the same as, or derive from, the destination's, otherwise System.ArrayTypeMismatchException is thrown. The two arrays may be the same array with overlapping ranges.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Convert All
FunctionA new array made by passing each element through a converter, for turning an array of one type into another, such as numbers into labels.
ConvertAll -> TOutput Array
array: TInput Array
converter: Converter<TInput, TOutput>TOutput[] ConvertAll(
TInput[] array,
Converter<TInput, TOutput> converter)Parameters
| name | type | default | description |
|---|---|---|---|
| array | TInput Array | — | The array to convert; it is left unchanged, and null throws System.ArgumentNullException. |
| converter | Converter<TInput, TOutput> | — | The function applied to each element; null throws System.ArgumentNullException. |
Returns
| result | TOutput Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Copy
FunctionOverload 1 of 4
Copy
sourceArray: Array
sourceIndex: Integer
destinationArray: Array
destinationIndex: Integer
length: Integervoid Copy(
Array sourceArray,
int sourceIndex,
Array destinationArray,
int destinationIndex,
int length)Copies a run of elements from one position in an array to a position in another (or the same) array, converting element types where a widening or boxing conversion allows.
Parameters
| name | type | default | description |
|---|---|---|---|
| sourceArray | Array | — | The array to copy from. |
| sourceIndex | Integer | — | The index in the source where copying starts. |
| destinationArray | Array | — | The array to copy into; it must have the same number of dimensions as the source, otherwise System.RankException is thrown. |
| destinationIndex | Integer | — | The index in the destination where the first copied element lands. |
| length | Integer | — | How many elements to copy; a run past the end of either array throws System.ArgumentException. |
Remarks
Overlapping ranges within the same array are copied correctly. If an element cannot be converted partway through, the destination may be left partly written; use Constrained Copy when that matters.
Overload 2 of 4
Copy
sourceArray: Array
destinationArray: Array
length: Integervoid Copy(Array sourceArray, Array destinationArray, int length)
Copies the first elements of one array into the start of another, converting element types where a widening or boxing conversion allows.
Parameters
| name | type | default | description |
|---|---|---|---|
| sourceArray | Array | — | The array to copy from. |
| destinationArray | Array | — | The array to copy into; it must have the same number of dimensions as the source, otherwise System.RankException is thrown. |
| length | Integer | — | How many elements to copy; more than either array holds throws System.ArgumentException. |
Overload 3 of 4
Copy
sourceArray: Array
sourceIndex: Large Integer
destinationArray: Array
destinationIndex: Large Integer
length: Large Integervoid Copy(
Array sourceArray,
long sourceIndex,
Array destinationArray,
long destinationIndex,
long length)Copies a run of elements from one array into another, taking 64-bit positions and count; behaves exactly like the 32-bit Copy.
Parameters
| name | type | default | description |
|---|---|---|---|
| sourceArray | Array | — | The array to copy from. |
| sourceIndex | Large Integer | — | The index in the source where copying starts. |
| destinationArray | Array | — | The array to copy into; it must have the same number of dimensions as the source. |
| destinationIndex | Large Integer | — | The index in the destination where the first copied element lands. |
| length | Large Integer | — | How many elements to copy; a run past the end of either array throws System.ArgumentException. |
Remarks
The values must still fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown.
Overload 4 of 4
Copy
sourceArray: Array
destinationArray: Array
length: Large Integervoid Copy(
Array sourceArray,
Array destinationArray,
long length)Copies the first elements of one array into the start of another, taking a 64-bit count; behaves exactly like the 32-bit Copy.
Parameters
| name | type | default | description |
|---|---|---|---|
| sourceArray | Array | — | The array to copy from. |
| destinationArray | Array | — | The array to copy into; it must have the same number of dimensions as the source. |
| length | Large Integer | — | How many elements to copy; it must fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Copy To
FunctionOverload 1 of 2
CopyTo(source: Array, destination: Array, index: Large Integer)
void CopyTo(Array source, Array destination, long index)
Copies every element of a one-dimensional array into another array, starting at a 64-bit position in the destination.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | Array | — | The one-dimensional array to copy from; a multidimensional array throws System.RankException. |
| destination | Array | — | The one-dimensional array to copy into; null throws System.ArgumentNullException, and a multidimensional array throws System.ArgumentException. |
| index | Large Integer | — | The position in the destination where the first element lands; it must leave room for every source element, otherwise System.ArgumentException is thrown, and it must fit in the 32-bit range. |
Overload 2 of 2
CopyTo(source: Array, destination: Array, index: Integer)
void CopyTo(Array source, Array destination, int index)
Copies every element of a one-dimensional array into another array, starting at the given position in the destination.
Parameters
| name | type | default | description |
|---|---|---|---|
| source | Array | — | The one-dimensional array to copy from; a multidimensional array throws System.RankException. |
| destination | Array | — | The one-dimensional array to copy into; null throws System.ArgumentNullException, and a multidimensional array throws System.ArgumentException. |
| index | Integer | — | The position in the destination where the first element lands; negative throws System.ArgumentOutOfRangeException, and too little room for every source element throws System.ArgumentException. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Create Instance
FunctionOverload 1 of 6
CreateInstance -> Array
elementType: Type
lengths: Integer Array
lowerBounds: Integer ArrayArray CreateInstance(
Type elementType,
int[] lengths,
int[] lowerBounds)A new array of any element type and dimension count, where each dimension can start at an index other than 0 (for example a grid indexed from 1).
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| lengths | Integer Array | — | The size of each dimension; its count is the number of dimensions. |
| lowerBounds | Integer Array | — | The starting index of each dimension; it must have as many entries as Lengths, otherwise System.ArgumentException is thrown. |
Returns
| result | Array |
Remarks
Every element starts at its type's default value. Element types that cannot form an array, such as void, throw System.NotSupportedException.
Overload 2 of 6
CreateInstance -> Array
elementType: Type
lengths: Large Integer ArrayArray CreateInstance(Type elementType, params long[] lengths)
A new zero-based array of any element type, with one dimension per entry in the size list, given as 64-bit sizes.
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| lengths | Large Integer Array | — | The size of each dimension; an empty list throws System.ArgumentException. |
Returns
| result | Array |
Remarks
Every element starts at its type's default value. Each size must fit in the 32-bit range, otherwise System.ArgumentOutOfRangeException is thrown.
Overload 3 of 6
CreateInstance -> Array
elementType: Type
length1: Integer
length2: Integer
length3: IntegerArray CreateInstance(
Type elementType,
int length1,
int length2,
int length3)A new zero-based three-dimensional array of any element type, for volumes such as voxel grids.
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| length1 | Integer | — | The size of the first dimension; negative throws System.ArgumentOutOfRangeException. |
| length2 | Integer | — | The size of the second dimension; negative throws System.ArgumentOutOfRangeException. |
| length3 | Integer | — | The size of the third dimension; negative throws System.ArgumentOutOfRangeException. |
Returns
| result | Array |
Overload 4 of 6
CreateInstance -> Array
elementType: Type
length1: Integer
length2: IntegerArray CreateInstance(Type elementType, int length1, int length2)
A new zero-based two-dimensional array of any element type, for grids and tables.
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| length1 | Integer | — | The size of the first dimension (rows); negative throws System.ArgumentOutOfRangeException. |
| length2 | Integer | — | The size of the second dimension (columns); negative throws System.ArgumentOutOfRangeException. |
Returns
| result | Array |
Overload 5 of 6
CreateInstance(elementType: Type, length: Integer) -> Array
Array CreateInstance(Type elementType, int length)
A new zero-based one-dimensional array of an element type chosen at run time.
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| length | Integer | — | How many elements the array has; negative throws System.ArgumentOutOfRangeException. |
Returns
| result | Array |
Overload 6 of 6
CreateInstance -> Array
elementType: Type
lengths: Integer ArrayArray CreateInstance(Type elementType, params int[] lengths)
A new zero-based array of any element type, with one dimension per entry in the size list.
Parameters
| name | type | default | description |
|---|---|---|---|
| elementType | Type | — | The type of each element. |
| lengths | Integer Array | — | The size of each dimension; an empty list throws System.ArgumentException, and a negative size throws System.ArgumentOutOfRangeException. |
Returns
| result | Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Create Instance From Array Type
FunctionOverload 1 of 3
CreateInstanceFromArrayType -> Array
arrayType: Type
lengths: Integer ArrayArray CreateInstanceFromArrayType(
Type arrayType,
params int[] lengths)A new array of the given array type (for example a number grid type), with the given size for each of its dimensions.
Parameters
| name | type | default | description |
|---|---|---|---|
| arrayType | Type | — | The array type to create, not its element type; a type that is not an array throws System.ArgumentException. |
| lengths | Integer Array | — | The size of each dimension; the count must match the array type's dimension count, otherwise System.ArgumentException is thrown. |
Returns
| result | Array |
Overload 2 of 3
CreateInstanceFromArrayType -> Array
arrayType: Type
lengths: Integer Array
lowerBounds: Integer ArrayArray CreateInstanceFromArrayType(
Type arrayType,
int[] lengths,
int[] lowerBounds)A new array of the given array type, with a size and a starting index for each dimension.
Parameters
| name | type | default | description |
|---|---|---|---|
| arrayType | Type | — | The array type to create, not its element type; a type that is not an array throws System.ArgumentException. |
| lengths | Integer Array | — | The size of each dimension; the count must match the array type's dimension count. |
| lowerBounds | Integer Array | — | The starting index of each dimension; it must have as many entries as Lengths. |
Returns
| result | Array |
Overload 3 of 3
CreateInstanceFromArrayType -> Array
arrayType: Type
length: IntegerArray CreateInstanceFromArrayType(Type arrayType, int length)
A new one-dimensional array of the given array type and length.
Parameters
| name | type | default | description |
|---|---|---|---|
| arrayType | Type | — | The one-dimensional array type to create, not its element type; a type that is not an array throws System.ArgumentException. |
| length | Integer | — | How many elements the array has; negative throws System.ArgumentOutOfRangeException. |
Returns
| result | Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Parse Comma Separated Boolean Array
FunctionThis node carries no documentation.
CSVBoolArray(value: Text) -> Truth Array
bool[] CSVBoolArray(string value)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | Text | — |
Returns
| result | Truth Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Parse Comma Separated Number Array
FunctionThis node carries no documentation.
CSVNumberArray(value: Text) -> Number Array
double[] CSVNumberArray(string value)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | Text | — |
Returns
| result | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Parse Comma Separated Text Names
FunctionThis node carries no documentation.
CSVStringArray(value: Text) -> Text Array
string[] CSVStringArray(string value)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | Text | — |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Duplicate As Array
FunctionThis node carries no documentation.
DuplicateAsArray(source: TType, count: Integer) -> TType Array
TType[] DuplicateAsArray(TType source, int count = 3)
Parameters
| name | type | default | description |
|---|---|---|---|
| source | TType | — | |
| count | Integer | 3 |
Returns
| result | TType Array |
Remarks
Prefer strongly typed over object-boxed version of ArrayRoutines.DuplicateAsArray.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Empty
FunctionAn array with no elements, for when a result has nothing in it; the same shared instance is returned every time, so it costs no allocation.
Empty() -> T Array
T[] Empty()
Returns
| result | T Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Exists
FunctionWhether at least one element passes a test, for questions such as "is any value negative?".
Exists(array: T Array, match: Predicate<T>) -> Truth
bool Exists(T[] array, Predicate<T> match)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to check; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Fill
FunctionOverload 1 of 2
Fill
array: T Array
value: T
startIndex: Integer
count: Integervoid Fill(T[] array, T value, int startIndex, int count)
Overwrites a run of elements with one value, leaving the rest of the array as it was.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to fill in place; null throws System.ArgumentNullException. |
| value | T | — | The value written into each element of the run. |
| startIndex | Integer | — | The index of the first element to overwrite. |
| count | Integer | — | How many elements to overwrite; a run outside the array throws System.ArgumentOutOfRangeException. |
Overload 2 of 2
Fill(array: T Array, value: T)
void Fill(T[] array, T value)
Overwrites every element of the array with one value, for resetting it to a known state.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to fill in place; null throws System.ArgumentNullException. |
| value | T | — | The value written into every element. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Find
FunctionThe first element, from the front, that passes a test.
Find(array: T Array, match: Predicate<T>) -> T
T Find(T[] array, Predicate<T> match)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| Result | T |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Find All
FunctionEvery element that passes a test, as a new array, for filtering an array down to the entries you want.
FindAll(array: T Array, match: Predicate<T>) -> T Array
T[] FindAll(T[] array, Predicate<T> match)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to filter; it is left unchanged, and null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | T Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Find Index
FunctionOverload 1 of 3
FindIndex -> Integer
array: T Array
startIndex: Integer
count: Integer
match: Predicate<T>int FindIndex(
T[] array,
int startIndex,
int count,
Predicate<T> match)The position of the first element passing a test within a section of the array, searching forwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| startIndex | Integer | — | The index where the search starts. |
| count | Integer | — | How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
Overload 2 of 3
FindIndex(array: T Array, match: Predicate<T>) -> Integer
int FindIndex(T[] array, Predicate<T> match)
The position of the first element that passes a test, searching from the front.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
Overload 3 of 3
FindIndex -> Integer
array: T Array
startIndex: Integer
match: Predicate<T>int FindIndex(T[] array, int startIndex, Predicate<T> match)
The position of the first element passing a test, searching forwards from a given index to the end.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| startIndex | Integer | — | The index where the search starts; outside 0 to the array's length throws System.ArgumentOutOfRangeException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Find Last
FunctionThe last element, searching from the back, that passes a test.
FindLast(array: T Array, match: Predicate<T>) -> T
T FindLast(T[] array, Predicate<T> match)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| Result | T |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Find Last Index
FunctionOverload 1 of 3
FindLastIndex(array: T Array, match: Predicate<T>) -> Integer
int FindLastIndex(T[] array, Predicate<T> match)
The position of the last element that passes a test, searching from the back.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
Overload 2 of 3
FindLastIndex -> Integer
array: T Array
startIndex: Integer
match: Predicate<T>int FindLastIndex(T[] array, int startIndex, Predicate<T> match)
The position of the last element passing a test, searching backwards from a given index to the start.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| startIndex | Integer | — | The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
Overload 3 of 3
FindLastIndex -> Integer
array: T Array
startIndex: Integer
count: Integer
match: Predicate<T>int FindLastIndex(
T[] array,
int startIndex,
int count,
Predicate<T> match)The position of the last element passing a test within a section that ends at a given index, searching backwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| startIndex | Integer | — | The index where the backward search starts, which is the last element of the section. |
| count | Integer | — | How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Fold
FunctionThe whole array folded into one value: starting from the seed, function(accumulated, element), left to right.
Fold -> Number
values: Number Array
seed: Number
function: Func<Number, Number, Number>double Fold(
double[] values,
double seed,
Func<double, double, double> function)Parameters
| name | type | default | description |
|---|---|---|---|
| values | Number Array | — | |
| seed | Number | — | |
| function | Func<Number, Number, Number> | — |
Returns
| result | Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
For Each
FunctionRuns an action once for each element, front to back, for side effects such as printing or accumulating.
ForEach(array: T Array, action: Action<T>)
void ForEach(T[] array, Action<T> action)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to walk; null throws System.ArgumentNullException. |
| action | Action<T> | — | The action run on each element; null throws System.ArgumentNullException. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Enumerator
FunctionAn enumerator that walks every element of the array in order; a multidimensional array is walked with the last dimension changing fastest.
GetEnumerator(array: Array) -> IEnumerator
IEnumerator GetEnumerator(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to walk. |
Returns
| result | IEnumerator |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Length
FunctionThe number of elements along one dimension, for example the number of rows (dimension 0) or columns (dimension 1) of a grid.
GetLength(array: Array, dimension: Integer) -> Integer
int GetLength(Array array, int dimension)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
| dimension | Integer | — | The zero-based dimension to measure; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Long Length
FunctionThe number of elements along one dimension, as a 64-bit number.
GetLongLength(array: Array, dimension: Integer) -> Large Integer
long GetLongLength(Array array, int dimension)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
| dimension | Integer | — | The zero-based dimension to measure; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException. |
Returns
| result | Large Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Lower Bound
FunctionThe first valid index along one dimension; 0 for ordinary arrays, other values only for arrays created with explicit lower bounds.
GetLowerBound(array: Array, dimension: Integer) -> Integer
int GetLowerBound(Array array, int dimension)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
| dimension | Integer | — | The zero-based dimension to inspect; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Upper Bound
FunctionThe last valid index along one dimension, inclusive; for an ordinary array this is that dimension's length minus 1, and -1 for an empty dimension.
GetUpperBound(array: Array, dimension: Integer) -> Integer
int GetUpperBound(Array array, int dimension)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
| dimension | Integer | — | The zero-based dimension to inspect; below 0 or not less than the array's dimension count throws System.IndexOutOfRangeException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Get Value
FunctionOverload 1 of 8
GetValue -> Any
array: Array
index1: Large Integer
index2: Large Integer
index3: Large Integerobject GetValue(
Array array,
long index1,
long index2,
long index3)Reads the element at a position in a three-dimensional array, given as 64-bit indices.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The three-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index1 | Large Integer | — | The index along the first dimension. |
| index2 | Large Integer | — | The index along the second dimension. |
| index3 | Large Integer | — | The index along the third dimension. |
Returns
| result | Any |
Overload 2 of 8
GetValue -> Any
array: Array
index1: Large Integer
index2: Large Integerobject GetValue(Array array, long index1, long index2)
Reads the element at a position in a two-dimensional array, given as 64-bit indices.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The two-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index1 | Large Integer | — | The index along the first dimension (row). |
| index2 | Large Integer | — | The index along the second dimension (column). |
Returns
| result | Any |
Overload 3 of 8
GetValue(array: Array, index: Large Integer) -> Any
object GetValue(Array array, long index)
Reads the element at a position in a one-dimensional array, given as a 64-bit index.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index | Large Integer | — | The position of the element. |
Returns
| result | Any |
Overload 4 of 8
GetValue(array: Array, index: Integer) -> Any
object GetValue(Array array, int index)
Reads the element at a position in a one-dimensional array of any element type.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index | Integer | — | The position of the element. |
Returns
| result | Any |
Overload 5 of 8
GetValue(array: Array, index1: Integer, index2: Integer) -> Any
object GetValue(Array array, int index1, int index2)
Reads the element at a row and column of a two-dimensional array.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The two-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index1 | Integer | — | The index along the first dimension (row). |
| index2 | Integer | — | The index along the second dimension (column). |
Returns
| result | Any |
Overload 6 of 8
GetValue -> Any
array: Array
index1: Integer
index2: Integer
index3: Integerobject GetValue(Array array, int index1, int index2, int index3)
Reads the element at a position in a three-dimensional array.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The three-dimensional array to read; any other dimension count throws System.ArgumentException. |
| index1 | Integer | — | The index along the first dimension. |
| index2 | Integer | — | The index along the second dimension. |
| index3 | Integer | — | The index along the third dimension. |
Returns
| result | Any |
Overload 7 of 8
GetValue(array: Array, indices: Integer Array) -> Any
object GetValue(Array array, params int[] indices)
Reads the element at a position given as one index per dimension, for arrays of any dimension count.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to read. |
| indices | Integer Array | — | One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and null throws System.ArgumentNullException. |
Returns
| result | Any |
Overload 8 of 8
GetValue(array: Array, indices: Large Integer Array) -> Any
object GetValue(Array array, params long[] indices)
Reads the element at a position given as one 64-bit index per dimension, for arrays of any dimension count.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to read. |
| indices | Large Integer Array | — | One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and null throws System.ArgumentNullException. |
Returns
| result | Any |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Index Of
FunctionOverload 1 of 6
IndexOf -> Integer
array: T Array
value: T
startIndex: Integer
count: Integerint IndexOf(T[] array, T value, int startIndex, int count)
The position of the first element equal to a value within a section of the array, searching forwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the search starts. |
| count | Integer | — | How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 2 of 6
IndexOf -> Integer
array: T Array
value: T
startIndex: Integerint IndexOf(T[] array, T value, int startIndex)
The position of the first element equal to a value, searching forwards from a given index to the end.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the search starts; outside 0 to the array's length throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 3 of 6
IndexOf(array: T Array, value: T) -> Integer
int IndexOf(T[] array, T value)
The position of the first element equal to a value, searching from the front.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
Returns
| result | Integer |
Overload 4 of 6
IndexOf(array: Array, value: Any) -> Integer
int IndexOf(Array array, object value)
The position of the first element equal to a value in a one-dimensional array of any element type, searching from the front.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
Returns
| result | Integer |
Overload 5 of 6
IndexOf -> Integer
array: Array
value: Any
startIndex: Integerint IndexOf(Array array, object value, int startIndex)
The position of the first element equal to a value in a one-dimensional array of any element type, searching forwards from a given index to the end.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the search starts; outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 6 of 6
IndexOf -> Integer
array: Array
value: Any
startIndex: Integer
count: Integerint IndexOf(
Array array,
object value,
int startIndex,
int count)The position of the first element equal to a value within a section of a one-dimensional array of any element type, searching forwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the search starts. |
| count | Integer | — | How many elements to examine; a section outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Initialize
FunctionRuns the element type's parameterless constructor on every element of an array of value types; for arrays of objects, numbers or other types without such a constructor it does nothing.
Initialize(array: Array)
void Initialize(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to initialise in place. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Is Fixed Size
FunctionWhether the array's size is fixed; always true, since an array cannot grow or shrink in place (Resize makes a new array instead).
IsFixedSize(array: Array) -> Truth
bool IsFixedSize(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Is Read Only
FunctionWhether the array's elements can be changed; always false for an array, because every array's elements are writable (wrap it with As Read Only for a view that cannot be written through).
IsReadOnly(array: Array) -> Truth
bool IsReadOnly(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Is Synchronized
FunctionWhether access to the array is thread-safe on its own; always false for an array, so lock on SyncRoot when several threads share one.
IsSynchronized(array: Array) -> Truth
bool IsSynchronized(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Last Index Of
FunctionOverload 1 of 6
LastIndexOf -> Integer
array: Array
value: Any
startIndex: Integer
count: Integerint LastIndexOf(
Array array,
object value,
int startIndex,
int count)The position of the last element equal to a value within a section of a one-dimensional array of any element type that ends at a given index, searching backwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the backward search starts, which is the last element of the section. |
| count | Integer | — | How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 2 of 6
LastIndexOf -> Integer
array: T Array
value: T
startIndex: Integer
count: Integerint LastIndexOf(T[] array, T value, int startIndex, int count)
The position of the last element equal to a value within a section that ends at a given index, searching backwards.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the backward search starts, which is the last element of the section. |
| count | Integer | — | How many elements to examine, going backwards; a section outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 3 of 6
LastIndexOf -> Integer
array: T Array
value: T
startIndex: Integerint LastIndexOf(T[] array, T value, int startIndex)
The position of the last element equal to a value, searching backwards from a given index to the start.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 4 of 6
LastIndexOf(array: T Array, value: T) -> Integer
int LastIndexOf(T[] array, T value)
The position of the last element equal to a value, searching from the back.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to search; null throws System.ArgumentNullException. |
| value | T | — | The value to look for, compared by equality. |
Returns
| result | Integer |
Overload 5 of 6
LastIndexOf -> Integer
array: Array
value: Any
startIndex: Integerint LastIndexOf(Array array, object value, int startIndex)
The position of the last element equal to a value in a one-dimensional array of any element type, searching backwards from a given index to the start.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
| startIndex | Integer | — | The index where the backward search starts; outside the array throws System.ArgumentOutOfRangeException. |
Returns
| result | Integer |
Overload 6 of 6
LastIndexOf(array: Array, value: Any) -> Integer
int LastIndexOf(Array array, object value)
The position of the last element equal to a value in a one-dimensional array of any element type, searching from the back.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to search; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| value | Any | — | The value to look for, compared by equality. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Length
FunctionThe total number of elements across all dimensions of the array, so a 3 by 4 grid gives 12.
Length(array: Array) -> Integer
int Length(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to count. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Long Length
FunctionThe total number of elements across all dimensions of the array, as a 64-bit number; use it instead of Length when a count could exceed the 32-bit range.
LongLength(array: Array) -> Large Integer
long LongLength(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to count. |
Returns
| result | Large Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Make Array
FunctionThis node carries no documentation.
MakeArray(count: Integer) -> TType Array
TType[] MakeArray(int count)
Parameters
| name | type | default | description |
|---|---|---|---|
| count | Integer | — |
Returns
| result | TType Array |
Remarks
The element type is the node's TType generic argument (a node property since format v1.2).
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Make Boolean Array
FunctionThis node carries no documentation.
MakeBoolArray(values: Truth Array) -> Truth Array
bool[] MakeBoolArray(params bool[] values)
Parameters
| name | type | default | description |
|---|---|---|---|
| values | Truth Array | — |
Returns
| result | Truth Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Make Number Array
FunctionThis node carries no documentation.
MakeNumberArray(values: Number Array) -> Number Array
double[] MakeNumberArray(params double[] values)
Parameters
| name | type | default | description |
|---|---|---|---|
| values | Number Array | — |
Returns
| result | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Make Text Array
FunctionThis node carries no documentation.
MakeStringArray(values: Text Array) -> Text Array
string[] MakeStringArray(params string[] values)
Parameters
| name | type | default | description |
|---|---|---|---|
| values | Text Array | — |
Returns
| result | Text Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Map
FunctionEach element through a function: the array that comes back is the results, in order.
Map -> Number Array
values: Number Array
function: Func<Number, Number>double[] Map(double[] values, Func<double, double> function)
Parameters
| name | type | default | description |
|---|---|---|---|
| values | Number Array | — | |
| function | Func<Number, Number> | — |
Returns
| result | Number Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Max Length
FunctionThe largest number of elements any single array can hold on this runtime (2,147,483,591), useful as an upper limit when checking a requested size before allocating.
MaxLength() -> Integer
int MaxLength()
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Rank
FunctionThe number of dimensions of the array: 1 for a plain list of values, 2 for a grid, 3 for a volume.
Rank(array: Array) -> Integer
int Rank(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to inspect. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Replicate
FunctionA new array holding the same value in every slot, for when you need a run of identical entries such as a row of zeros or a default label repeated.
Replicate(value: TType, count: Integer) -> TType Array
TType[] Replicate(TType value, int count)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | TType | — | The value placed in every slot. |
| count | Integer | — | How many slots the array has; 0 gives an empty array, and a negative count throws System.OverflowException. |
Returns
| result | TType Array |
Remarks
For a reference type every slot holds the same object, not a copy of it, so changing that object through one slot shows through all of them.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Resize
FunctionChanges an array's length by replacing it with a new array of the new size that keeps the existing elements from the front.
Resize(array: T Array, newSize: Integer)
void Resize(ref T[] array, int newSize)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to resize; on return it refers to the resized array. |
| newSize | Integer | — | The new number of elements; negative throws System.ArgumentOutOfRangeException. |
Remarks
Growing adds default-valued (0, false or null) elements at the end; shrinking drops the elements past the new length; the same size leaves the array alone. A null array is replaced by a new array of the requested size.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Reverse
FunctionOverload 1 of 4
Reverse(array: T Array, index: Integer, length: Integer)
void Reverse(T[] array, int index, int length)
Reverses the order of a run of elements in place, leaving the rest of the array as it was.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to modify; null throws System.ArgumentNullException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers; a negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException. |
Overload 2 of 4
Reverse(array: Array, index: Integer, length: Integer)
void Reverse(Array array, int index, int length)
Reverses the order of a run of elements in place in a one-dimensional array of any element type.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to modify; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers; a negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException. |
Overload 3 of 4
Reverse(array: Array)
void Reverse(Array array)
Reverses the order of all elements in place in a one-dimensional array of any element type, so the last becomes first.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to modify; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
Overload 4 of 4
Reverse(array: T Array)
void Reverse(T[] array)
Reverses the order of all elements in place, so the last becomes first.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to modify; null throws System.ArgumentNullException. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Set Value
FunctionOverload 1 of 8
SetValue
array: Array
value: Any
index1: Large Integer
index2: Large Integervoid SetValue(
Array array,
object value,
long index1,
long index2)Writes a value into a two-dimensional array at a row and column given as 64-bit indices.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The two-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index1 | Large Integer | — | The index along the first dimension (row). |
| index2 | Large Integer | — | The index along the second dimension (column); an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException. |
Overload 2 of 8
SetValue(array: Array, value: Any, index: Large Integer)
void SetValue(Array array, object value, long index)
Writes a value into a one-dimensional array at a position given as a 64-bit index.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index | Large Integer | — | The position to write; beyond the 32-bit range throws System.ArgumentOutOfRangeException, and outside the array throws System.IndexOutOfRangeException. |
Overload 3 of 8
SetValue(array: Array, value: Any, indices: Integer Array)
void SetValue(Array array, object value, params int[] indices)
Writes a value at a position given as one index per dimension, for arrays of any dimension count.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to write. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| indices | Integer Array | — | One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and an index outside its dimension throws System.IndexOutOfRangeException. |
Overload 4 of 8
SetValue
array: Array
value: Any
index1: Integer
index2: Integer
index3: Integervoid SetValue(
Array array,
object value,
int index1,
int index2,
int index3)Writes a value into a three-dimensional array at the given position.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The three-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index1 | Integer | — | The index along the first dimension. |
| index2 | Integer | — | The index along the second dimension. |
| index3 | Integer | — | The index along the third dimension; an index outside its dimension throws System.IndexOutOfRangeException. |
Overload 5 of 8
SetValue
array: Array
value: Any
index1: Integer
index2: Integervoid SetValue(Array array, object value, int index1, int index2)
Writes a value into a two-dimensional array at a row and column.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The two-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index1 | Integer | — | The index along the first dimension (row). |
| index2 | Integer | — | The index along the second dimension (column); an index outside its dimension throws System.IndexOutOfRangeException. |
Overload 6 of 8
SetValue(array: Array, value: Any, index: Integer)
void SetValue(Array array, object value, int index)
Writes a value into a one-dimensional array of any element type at the given position.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index | Integer | — | The position to write; outside the array throws System.IndexOutOfRangeException. |
Overload 7 of 8
SetValue(array: Array, value: Any, indices: Large Integer Array)
void SetValue(Array array, object value, params long[] indices)
Writes a value at a position given as one 64-bit index per dimension, for arrays of any dimension count.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array to write. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| indices | Large Integer Array | — | One index per dimension; a count different from the array's dimension count throws System.ArgumentException, and an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException. |
Overload 8 of 8
SetValue
array: Array
value: Any
index1: Large Integer
index2: Large Integer
index3: Large Integervoid SetValue(
Array array,
object value,
long index1,
long index2,
long index3)Writes a value into a three-dimensional array at a position given as 64-bit indices.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The three-dimensional array to write; any other dimension count throws System.ArgumentException. |
| value | Any | — | The value to store; one that cannot be converted to the element type throws System.InvalidCastException. |
| index1 | Large Integer | — | The index along the first dimension. |
| index2 | Large Integer | — | The index along the second dimension. |
| index3 | Large Integer | — | The index along the third dimension; an index beyond the 32-bit range throws System.ArgumentOutOfRangeException, and one outside its dimension throws System.IndexOutOfRangeException. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Sort
FunctionOverload 1 of 17
Sort
array: T Array
index: Integer
length: Integer
comparer: IComparer<T>void Sort(
T[] array,
int index,
int length,
IComparer<T> comparer)Sorts a run of elements in place using the given comparer, leaving the rest of the array as it was.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to sort; null throws System.ArgumentNullException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
| comparer | IComparer<T> | — | The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable. |
Remarks
The sort is not stable: elements that compare equal may change order. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.
Overload 2 of 17
Sort(keys: Array, items: Array)
void Sort(Array keys, Array items)
Sorts one array of keys in ascending order and rearranges a second array the same way, so each item stays paired with its key; use it to sort names by their scores, for example.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | Array | — | The one-dimensional array of keys to sort by; null throws System.ArgumentNullException. |
| items | Array | — | The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException. |
Remarks
The sort is not stable. Keys that are not comparable throw System.InvalidOperationException; either array being multidimensional throws System.RankException.
Overload 3 of 17
Sort(keys: Array, items: Array, comparer: IComparer)
void Sort(Array keys, Array items, IComparer comparer)
Sorts one array of keys using the given comparer and rearranges a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | Array | — | The one-dimensional array of keys to sort by; null throws System.ArgumentNullException. |
| items | Array | — | The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException. |
| comparer | IComparer | — | The ordering of the keys; null uses the keys' default ordering. |
Remarks
The sort is not stable. Either array being multidimensional throws System.RankException.
Overload 4 of 17
Sort(keys: Array, items: Array, index: Integer, length: Integer)
void Sort(Array keys, Array items, int index, int length)
Sorts a run of keys in ascending order and rearranges the matching run of a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | Array | — | The one-dimensional array of keys to sort by; null throws System.ArgumentNullException. |
| items | Array | — | The array rearranged alongside the keys; null sorts only the keys. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.
Overload 5 of 17
Sort
keys: Array
items: Array
index: Integer
length: Integer
comparer: IComparervoid Sort(
Array keys,
Array items,
int index,
int length,
IComparer comparer)Sorts a run of keys using the given comparer and rearranges the matching run of a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | Array | — | The one-dimensional array of keys to sort by; null throws System.ArgumentNullException. |
| items | Array | — | The array rearranged alongside the keys; null sorts only the keys. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
| comparer | IComparer | — | The ordering of the keys; null uses the keys' default ordering. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.
Overload 6 of 17
Sort(array: Array, comparer: IComparer)
void Sort(Array array, IComparer comparer)
Sorts a one-dimensional array of any element type in place using the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| comparer | IComparer | — | The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable. |
Remarks
The sort is not stable: elements that compare equal may change order.
Overload 7 of 17
Sort(array: Array, index: Integer, length: Integer)
void Sort(Array array, int index, int length)
Sorts a run of elements of a one-dimensional array of any element type in place, in ascending order.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, a run past the end throws System.ArgumentException, and elements that are not comparable throw System.InvalidOperationException.
Overload 8 of 17
Sort(array: T Array, comparison: Comparison<T>)
void Sort(T[] array, Comparison<T> comparison)
Sorts the whole array in place using a comparison function, for orderings such as by length or descending.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to sort; null throws System.ArgumentNullException. |
| comparison | Comparison<T> | — | The function that orders two elements; null throws System.ArgumentNullException. |
Remarks
The comparison returns a negative number when the first argument comes first, 0 when they are equal and a positive number when the second comes first. The sort is not stable.
Overload 9 of 17
Sort
array: Array
index: Integer
length: Integer
comparer: IComparervoid Sort(
Array array,
int index,
int length,
IComparer comparer)Sorts a run of elements of a one-dimensional array of any element type in place, using the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
| comparer | IComparer | — | The ordering to sort by; null uses the elements' default ordering. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end throws System.ArgumentException.
Overload 10 of 17
Sort(array: T Array, index: Integer, length: Integer)
void Sort(T[] array, int index, int length)
Sorts a run of elements in place in ascending order, leaving the rest of the array as it was.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to sort; null throws System.ArgumentNullException. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, a run past the end throws System.ArgumentException, and elements that are not comparable throw System.InvalidOperationException.
Overload 11 of 17
Sort(array: Array)
void Sort(Array array)
Sorts a one-dimensional array of any element type in place, in ascending order.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The one-dimensional array to sort; null throws System.ArgumentNullException, and a multidimensional array throws System.RankException. |
Remarks
The sort is not stable. Elements that are not comparable throw System.InvalidOperationException.
Overload 12 of 17
Sort(keys: TKey Array, items: TValue Array)
void Sort(TKey[] keys, TValue[] items)
Sorts an array of keys in ascending order and rearranges a second array the same way, so each item stays paired with its key; use it to sort names by their scores, for example.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | TKey Array | — | The keys to sort by; null throws System.ArgumentNullException. |
| items | TValue Array | — | The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException. |
Remarks
The sort is not stable. Keys that are not comparable throw System.InvalidOperationException.
Overload 13 of 17
Sort(array: T Array, comparer: IComparer<T>)
void Sort(T[] array, IComparer<T> comparer)
Sorts the whole array in place using the given comparer.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to sort; null throws System.ArgumentNullException. |
| comparer | IComparer<T> | — | The ordering to sort by; null uses the elements' default ordering, which throws System.InvalidOperationException if the elements are not comparable. |
Remarks
The sort is not stable: elements that compare equal may change order.
Overload 14 of 17
Sort
keys: TKey Array
items: TValue Array
index: Integer
length: Integervoid Sort(TKey[] keys, TValue[] items, int index, int length)
Sorts a run of keys in ascending order and rearranges the matching run of a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | TKey Array | — | The keys to sort by; null throws System.ArgumentNullException. |
| items | TValue Array | — | The array rearranged alongside the keys; null sorts only the keys. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.
Overload 15 of 17
Sort
keys: TKey Array
items: TValue Array
index: Integer
length: Integer
comparer: IComparer<TKey>void Sort(
TKey[] keys,
TValue[] items,
int index,
int length,
IComparer<TKey> comparer)Sorts a run of keys using the given comparer and rearranges the matching run of a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | TKey Array | — | The keys to sort by; null throws System.ArgumentNullException. |
| items | TValue Array | — | The array rearranged alongside the keys; null sorts only the keys. |
| index | Integer | — | The index of the first element of the run. |
| length | Integer | — | How many elements the run covers. |
| comparer | IComparer<TKey> | — | The ordering of the keys; null uses the keys' default ordering. |
Remarks
The sort is not stable. A negative index or length throws System.ArgumentOutOfRangeException, and a run past the end of either array throws System.ArgumentException.
Overload 16 of 17
Sort(array: T Array)
void Sort(T[] array)
Sorts the whole array in place in ascending order: numbers smallest first, text alphabetically.
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to sort; null throws System.ArgumentNullException. |
Remarks
The sort is not stable. Elements that are not comparable throw System.InvalidOperationException.
Overload 17 of 17
Sort
keys: TKey Array
items: TValue Array
comparer: IComparer<TKey>void Sort(TKey[] keys, TValue[] items, IComparer<TKey> comparer)
Sorts an array of keys using the given comparer and rearranges a second array the same way, so each item stays paired with its key.
Parameters
| name | type | default | description |
|---|---|---|---|
| keys | TKey Array | — | The keys to sort by; null throws System.ArgumentNullException. |
| items | TValue Array | — | The array rearranged alongside the keys; null sorts only the keys, and an array shorter than the keys throws System.ArgumentException. |
| comparer | IComparer<TKey> | — | The ordering of the keys; null uses the keys' default ordering. |
Remarks
The sort is not stable.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
Sync Root
FunctionThe object to lock on when several threads share this array; for an ordinary array it is the array itself.
SyncRoot(array: Array) -> Any
object SyncRoot(Array array)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | Array | — | The array whose lock object is wanted. |
Returns
| result | Any |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library
True For All
FunctionWhether every element passes a test, for questions such as "are all values positive?".
TrueForAll(array: T Array, match: Predicate<T>) -> Truth
bool TrueForAll(T[] array, Predicate<T> match)
Parameters
| name | type | default | description |
|---|---|---|---|
| array | T Array | — | The array to check; null throws System.ArgumentNullException. |
| match | Predicate<T> | — | The test applied to each element; null throws System.ArgumentNullException. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Array Routines
- Package
- Standard Library