Divooka Reference

Vector

27 nodes

On this page 27

Make Vector

Function

Overload 1 of 4

Signature
DivookaTensor1D() -> Vector
DivookaTensor1D DivookaTensor1D()

Construct empty.

Returns

resultVector

Overload 2 of 4

Signature
DivookaTensor1D(values: IEnumerable<Number>) -> Vector
DivookaTensor1D DivookaTensor1D(IEnumerable<double> values)

Construct from (copy of) values.

Parameters

nametypedefaultdescription
valuesIEnumerable<Number>—

Returns

resultVector

Overload 3 of 4

Signature
DivookaTensor1D(values: Number Array) -> Vector
DivookaTensor1D DivookaTensor1D(params double[] values)

Construct from param arguments (no copy).

Parameters

nametypedefaultdescription
valuesNumber Array—

Returns

resultVector

Overload 4 of 4

Signature
op_Implicit(values: Number Array) -> Vector
DivookaTensor1D op_Implicit(double[] values)

This node carries no documentation.

Parameters

nametypedefaultdescription
valuesNumber Array—

Returns

VectorVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Contains

Function

Whether any element is exactly equal to Item; see DivookaTensor1D.IndexOf for what exact means.

Signature
Contains(Vector: Vector, item: Number) -> Truth
bool Contains(DivookaTensor1D Vector, double item)

Parameters

nametypedefaultdescription
VectorVector—
itemNumber—The value to look for.

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Copy

Function

Make a copy

Signature
Copy(Vector: Vector) -> Vector
DivookaTensor1D Copy(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Copy To

Function

Copies every element into Array, starting at Array Index.

Signature
CopyTo(Vector: Vector, array: Number Array, arrayIndex: Integer)
void CopyTo(
    DivookaTensor1D Vector,
    double[] array,
    int arrayIndex)

Parameters

nametypedefaultdescription
VectorVector—
arrayNumber Array—The array to fill; null throws System.ArgumentNullException, and one without room for every element from Array Index on throws System.ArgumentException.
arrayIndexInteger—The position in Array to start writing at; a negative number throws System.ArgumentOutOfRangeException.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Count

Function

The number of elements; the same as DivookaTensor1D.Length.

Signature
Count(Vector: Vector) -> Integer
int Count(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Index

Function

The positions of the elements as numbers, 0, 1, 2 and so on, one per element; handy as the x values when plotting the vector.

Signature
Index(Vector: Vector) -> Number Array
double[] Index(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Item

Function

The element at Index, counting from zero.

Signature
Item(Vector: Vector, index: Integer) -> Number
double Item(DivookaTensor1D Vector, int index)

Parameters

nametypedefaultdescription
VectorVector—
indexInteger—The zero-based position; below zero or at or past the length throws System.IndexOutOfRangeException.

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Length

Function

Get length of vector

Signature
Length(Vector: Vector) -> Integer
int Length(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Size

Function

Get string representation of size.

Signature
Size(Vector: Vector) -> Text
string Size(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Get Enumerator

Function

Goes through the elements in order.

Signature
GetEnumerator(Vector: Vector) -> IEnumerator<Number>
IEnumerator<double> GetEnumerator(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultIEnumerator<Number>
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Get Preview Array

Function

The elements as an array, for the preview display; this is the vector's own storage, not a copy.

Signature
GetPreviewArray(Vector: Vector) -> Array
Array GetPreviewArray(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultArray
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Get Preview String

Function

The elements as text for the preview display, one per line, written in the current culture's number format.

Signature
GetPreviewString(Vector: Vector) -> Text
string GetPreviewString(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Index Of

Function

The position of the first element equal to Item, counting from zero.

Signature
IndexOf(Vector: Vector, item: Number) -> Integer
int IndexOf(DivookaTensor1D Vector, double item)

Parameters

nametypedefaultdescription
VectorVector—
itemNumber—The value to look for.

Returns

resultInteger

Remarks

The match is exact, so a value that was computed slightly differently (0.1 + 0.2 against 0.3, for example) is not found.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Norm

Function

Another name for length

Signature
Norm(Vector: Vector) -> Integer
int Norm(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Shift

Function

Moves every element along by Offset positions, giving a new vector of the same length; the original is unchanged.

Signature
Shift -> Vector
    Vector: Vector
    offset: Integer
    fillZero: Truth
DivookaTensor1D Shift(
    DivookaTensor1D Vector,
    int offset,
    bool fillZero = true)

Parameters

nametypedefaultdescription
VectorVector—
offsetInteger—How many positions to move; positive toward the start, negative toward the end.
fillZeroTruthTrueTrue (the default) fills the freed places with 0; false fills them with the elements that fell off the other end, rotating the vector.

Returns

resultVector

Remarks

A positive offset moves elements toward the start: the element at position i + offset lands at position i, the first Offset elements fall off, and the freed places at the end are filled. A negative offset moves elements toward the end in the same way. An offset of zero gives a copy, and an offset as large as the length or larger gives all zeros whatever Fill Zero says.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

To Array

Function

Defensive copy

Signature
ToArray(Vector: Vector) -> Number Array
double[] ToArray(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

To String

Function

ToString override

Signature
ToString(Vector: Vector) -> Text
string ToString(DivookaTensor1D Vector)

Parameters

nametypedefaultdescription
VectorVector—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Accumulate Apply

Function

Overload 1 of 2

Signature
AccumulateApply -> (result: Number, path: Number Array)
    baseValue: Number
    vector: Number Array
    function: Accumulate Apply Function
double AccumulateApply(
    double baseValue,
    double[] vector,
    out double[] path,
    DivookaTensor1D.AccumulateApplyFunction function)

Applies certain operation starting from base value on top of entire vector and return the resulting vector and final value

Parameters

nametypedefaultdescription
baseValueNumber—
vectorNumber Array—
functionAccumulate Apply Function—

Returns

resultNumber
pathNumber Array

Overload 2 of 2

Signature
AccumulateApply -> (result: Number, path: Number Array)
    baseValue: Number
    vector: Number Array
    function: Func<Number, Number, Number>
double AccumulateApply(
    double baseValue,
    double[] vector,
    out double[] path,
    Func<double, double, double> function)

Starts from Base Value and combines it with each element of Vector in turn using Function, giving the final value and every value along the way; a running total is (previous, element) => previous + element.

Parameters

nametypedefaultdescription
baseValueNumber—The value to start from; it is also the answer when Vector is empty.
vectorNumber Array—The elements to fold in, in order; must not be null.
functionFunc<Number, Number, Number>—Given previous computed result and current element value, compute the next value

Returns

resultNumber
pathNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Addition Operation

Function

Overload 1 of 2

Signature
op_Addition(a: Vector, b: Vector) -> Vector
DivookaTensor1D op_Addition(
    DivookaTensor1D a,
    DivookaTensor1D b)

Adds two vectors

Parameters

nametypedefaultdescription
aVector—
bVector—

Returns

resultVector

Overload 2 of 2

Signature
op_Addition(a: Vector, v: Number) -> Vector
DivookaTensor1D op_Addition(DivookaTensor1D a, double v)

Adds a scalar to every element

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Bitwise Or Operation

Function

Overload 1 of 2

Signature
op_BitwiseOr(a: Vector, v: Number) -> Vector
DivookaTensor1D op_BitwiseOr(DivookaTensor1D a, double v)

Append an element

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector

Overload 2 of 2

Signature
op_BitwiseOr(a: Vector, b: Vector) -> Vector
DivookaTensor1D op_BitwiseOr(
    DivookaTensor1D a,
    DivookaTensor1D b)

Append an entire vector

Parameters

nametypedefaultdescription
aVector—
bVector—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Division Operation

Function

Overload 1 of 2

Signature
op_Division(a: Vector, b: Vector) -> Vector
DivookaTensor1D op_Division(
    DivookaTensor1D a,
    DivookaTensor1D b)

Divide element-wise

Parameters

nametypedefaultdescription
aVector—
bVector—

Returns

resultVector

Overload 2 of 2

Signature
op_Division(a: Vector, v: Number) -> Vector
DivookaTensor1D op_Division(DivookaTensor1D a, double v)

Multiply every element by a scalar

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Exclusive Or Operation

Function

Exponent element-wise

Signature
op_ExclusiveOr(a: Vector, v: Number) -> Vector
DivookaTensor1D op_ExclusiveOr(DivookaTensor1D a, double v)

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Op Implicit

Function

This node carries no documentation.

Overload 1 of 2

Signature
op_Implicit(values: Number Array) -> Vector
DivookaTensor1D op_Implicit(double[] values)

Parameters

nametypedefaultdescription
valuesNumber Array—

Returns

resultVector

Overload 2 of 2

Signature
op_Implicit(vector: Vector) -> Number Array
double[] op_Implicit(DivookaTensor1D vector)

Parameters

nametypedefaultdescription
vectorVector—

Returns

resultNumber Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Multiply Operation

Function

Overload 1 of 2

Signature
op_Multiply(a: Vector, b: Vector) -> Vector
DivookaTensor1D op_Multiply(
    DivookaTensor1D a,
    DivookaTensor1D b)

Multiply element-wise

Parameters

nametypedefaultdescription
aVector—
bVector—

Returns

resultVector

Overload 2 of 2

Signature
op_Multiply(a: Vector, v: Number) -> Vector
DivookaTensor1D op_Multiply(DivookaTensor1D a, double v)

Multiply every element by a scalar

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Subtraction Operation

Function

Overload 1 of 2

Signature
op_Subtraction(a: Vector, b: Vector) -> Vector
DivookaTensor1D op_Subtraction(
    DivookaTensor1D a,
    DivookaTensor1D b)

Subtract two vectors

Parameters

nametypedefaultdescription
aVector—
bVector—

Returns

resultVector

Overload 2 of 2

Signature
op_Subtraction(a: Vector, v: Number) -> Vector
DivookaTensor1D op_Subtraction(DivookaTensor1D a, double v)

Subtract a scalar to every element

Parameters

nametypedefaultdescription
aVector—
vNumber—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Unary Negation Operation

Function

Gets negative

Signature
op_UnaryNegation(a: Vector) -> Vector
DivookaTensor1D op_UnaryNegation(DivookaTensor1D a)

Parameters

nametypedefaultdescription
aVector—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics

Unary Plus Operation

Function

Identity (no copy is made)

Signature
op_UnaryPlus(a: Vector) -> Vector
DivookaTensor1D op_UnaryPlus(DivookaTensor1D a)

Parameters

nametypedefaultdescription
aVector—

Returns

resultVector
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vector
Package
Numerics