FsAlg


Vector<'T>

Generic vector type

Union Cases

Union CaseDescription
Vector(^T [])
Signature: ^T []
ZeroVector(^T)
Signature: ^T

Instance members

Instance memberDescription
Convert(f)
Signature: (f:(^T -> ^a)) -> Vector<^a>

Converts the elements of this vector to another type, using the given conversion function f

Copy()
Signature: unit -> Vector<^T>

Creates a copy of this vector

FirstItem
Signature: ^T

Gets the first element of this vector

GetEnumerator()
Signature: unit -> IEnumerator<^T>

Returns an enumerator that iterates through the elements of this vector

GetL1Norm()
Signature: unit -> ^T

Gets the L1 (Manhattan) norm of this vector

GetL2Norm()
Signature: unit -> ^T

Gets the L2 (Euclidean) norm of this vector

GetL2NormSq()
Signature: unit -> ^T

Gets the squared L2 (Euclidean) norm of this vector

GetLPNorm(p)
Signature: p:^T -> ^T

Gets the Lp norm (or p-norm) of this vector, with the given p

GetMax()
Signature: unit -> ^T

Gets the maximum element of this vector

GetMaxBy(f)
Signature: (f:(^T -> '?100554)) -> ^T

Gets the maximum element of this vector, compared by using Operators.max on the result of function f

GetMin()
Signature: unit -> ^T

Gets the minimum element of this vector

GetMinBy(f)
Signature: (f:(^T -> '?100549)) -> ^T

Gets the minimum element of this vector, compared by using Operators.min on the result of function f

GetSlice(lower, upper)
Signature: (lower:int option * upper:int option) -> Vector<^T>

Gets a subvector between bounds lower and upper

GetSubVector(s, c)
Signature: (s:int * c:int) -> Vector<^T>

Creates a new vector that contains the given subrange of elements, specified by start index s and count c

GetUnitVector()
Signature: unit -> Vector<^T>

Gets the unit vector codirectional with this vector

[i]
Signature: i:int -> ^T

The element of this vector at the given position i

[()]
Signature: unit -> int

The element of this vector at the given position i

Length
Signature: int

Gets the total number of elements of this vector

Split(n)
Signature: n:seq<int> -> seq<Vector<^T>>

Returns a sequence of vectors that are obtained by splitting this vector into subvectors whose lengths are given in sequence n

SplitEqual(n)
Signature: n:int -> seq<Vector<^T>>

Returns a sequence of vectors that are obtained by splitting this vector into n subvectors of equal length. The length of this vector must be an integer multiple of n, otherwise ArgumentException is raised.

ToArray()
Signature: unit -> ^T []

Converts this vector to an array

ToMathematicaString()
Signature: unit -> string

Gets a string representation of this vector that can be pasted into a Mathematica notebook

ToMatlabString()
Signature: unit -> string

Gets a string representation of this vector that can be pasted into MATLAB

ToSeq()
Signature: unit -> seq<^T>

Converts this vector to a sequence

Static members

Static memberDescription
( - )(a, b)
Signature: (a:^T * b:Vector<^T>) -> Vector<^T>

Subtracts each element of vector b from scalar a

( - )(a, b)
Signature: (a:Vector<^T> * b:^T) -> Vector<^T>

Subtracts scalar b from each element of vector a

( - )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> Vector<^T>

Subtracts vector b from vector a

( %* )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> Vector<^T>

Computes the cross product of vector a and vector b (three-dimensional)

( * )(a, b)
Signature: (a:^T * b:Vector<^T>) -> Vector<^T>

Multiplies each element of vector b by scalar a

( * )(a, b)
Signature: (a:Vector<^T> * b:^T) -> Vector<^T>

Multiplies each element of vector a by scalar b

( * )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> ^T

Computes the inner product (dot / scalar product) of vector a and vector b

( .* )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> Vector<^T>

Multiplies vector a and vector b element-wise (Hadamard product)

( ./ )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> Vector<^T>

Divides vector a by vector b element-wise (Hadamard division)

( / )(a, b)
Signature: (a:^T * b:Vector<^T>) -> Vector<^T>

Divides scalar a by each element of vector b

( / )(a, b)
Signature: (a:Vector<^T> * b:^T) -> Vector<^T>

Divides each element of vector a by scalar b

( ~- )(a)
Signature: a:Vector<^T> -> Vector<^T>

Gets the negative of Vector a

( + )(a, b)
Signature: (a:^T * b:Vector<^T>) -> Vector<^T>

Adds scalar a to each element of vector b

( + )(a, b)
Signature: (a:Vector<^T> * b:^T) -> Vector<^T>

Adds scalar b to each element of vector a

( + )(a, b)
Signature: (a:Vector<^T> * b:Vector<^T>) -> Vector<^T>

Adds vector a to vector b

op_Explicit(v)
Signature: v:Vector<^T> -> float []

Converts vector v to float[]

Zero
Signature: Vector<^T>

ZeroVector