Vector
Operations on Vector type. (Implementing functionality similar to Microsoft.FSharp.Collections.Array)
Functions and values
Function or value | Description |
append(v1 v2)
Signature: v1:Vector<^T> -> v2:Vector<^T> -> Vector<^T>
Type parameters: ^T |
Creates a vector that contains the elements of vector |
concat(v)
Signature: v:seq<Vector<^T>> -> Vector<^T>
Type parameters: ^T |
Builds a new vector that contains the elements of each of the given sequence of vectors |
copy(v)
Signature: v:Vector<^T> -> Vector<^T>
Type parameters: ^T |
Creates a copy of vector |
create(n v)
Signature: n:int -> v:^T -> Vector<^T>
Type parameters: ^T |
Creates a vector with |
createBasis(n i v)
Signature: n:int -> i:int -> v:^T -> Vector<^T>
Type parameters: ^T |
Creates a vector with |
exists(p v)
Signature: p:(^T -> bool) -> v:Vector<^T> -> bool
Type parameters: ^T |
Tests if any element of vector |
exists2(p v1 v2)
Signature: p:(^T1 -> ^T2 -> bool) -> v1:Vector<^T1> -> v2:Vector<^T2> -> bool
Type parameters: ^T1, ^T2 |
Tests if any pair of corresponding elements of vectors |
fill(v s c a)
Signature: v:Vector<^T> -> s:int -> c:int -> a:^T -> unit
Type parameters: ^T |
Fills a range of elements of vector |
find(p v)
Signature: p:(^T -> bool) -> v:Vector<^T> -> ^T
Type parameters: ^T |
Returns the first element of vector |
findIndex(p v)
Signature: p:(^T -> bool) -> v:Vector<^T> -> int
Type parameters: ^T |
Returns the index of the first element of vector |
fold(f s v)
Signature: f:('S -> ^T -> 'S) -> s:'S -> v:Vector<^T> -> 'S
Type parameters: 'S, ^T |
Applies function |
fold2(f s v1 v2)
Signature: f:('S -> ^T1 -> ^T2 -> 'S) -> s:'S -> v1:Vector<^T1> -> v2:Vector<^T2> -> 'S
Type parameters: 'S, ^T1, ^T2 |
Applies function |
foldBack(f v s)
Signature: f:(^T -> 'S -> 'S) -> v:Vector<^T> -> s:'S -> 'S
Type parameters: ^T, 'S |
Applies function |
foldBack2(f v1 v2 s)
Signature: f:(^T1 -> ^T2 -> 'S -> 'S) -> v1:Vector<^T1> -> v2:Vector<^T2> -> s:'S -> 'S
Type parameters: ^T1, ^T2, 'S |
Applies function |
forall(p v)
Signature: p:(^T -> bool) -> v:Vector<^T> -> bool
Type parameters: ^T |
Tests if all elements of vector |
forall2(p v1 v2)
Signature: p:(^T1 -> ^T2 -> bool) -> v1:Vector<^T1> -> v2:Vector<^T2> -> bool
Type parameters: ^T1, ^T2 |
Tests if all corresponding elements of vectors |
get(v i)
Signature: v:Vector<^T> -> i:int -> ^T
Type parameters: ^T |
Gets the element of vector |
init(n f)
Signature: n:int -> f:(int -> ^T) -> Vector<^T>
Type parameters: ^T |
Creates a vector with dimension |
iter(f v)
Signature: f:(^T -> unit) -> v:Vector<^T> -> unit
Type parameters: ^T |
Applies function |
iter2(f v1 v2)
Signature: f:(^T1 -> ^T2 -> unit) -> v1:Vector<^T1> -> v2:Vector<^T2> -> unit
Type parameters: ^T1, ^T2 |
Applies function |
iteri(f v)
Signature: f:(int -> ^T -> unit) -> v:Vector<^T> -> unit
Type parameters: ^T |
Applies function |
iteri2(f v1 v2)
Signature: f:(int -> ^T1 -> ^T2 -> unit) -> v1:Vector<^T1> -> v2:Vector<^T2> -> unit
Type parameters: ^T1, ^T2 |
Applies function |
l1norm(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the L1 (Manhattan) norm of vector |
l2norm(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the L2 (Euclidean) norm of vector |
l2normSq(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the squared L2 (Euclidean) norm of vector |
length(v)
Signature: v:Vector<^T> -> int
Type parameters: ^T |
Returns the length of vector |
lpnorm(p v)
Signature: p:^T -> v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the Lp norm (or p-norm) of vector |
map(f v)
Signature: f:(^T -> ^U) -> v:Vector<^T> -> Vector<^U>
Type parameters: ^T, ^U |
Creates a vector whose elements are the results of applying function |
map2(f v1 v2)
Signature: f:(^T1 -> ^T2 -> ^U) -> v1:Vector<^T1> -> v2:Vector<^T2> -> Vector<^U>
Type parameters: ^T1, ^T2, ^U |
Creates a vector whose elements are the results of applying function |
mapi(f v)
Signature: f:(int -> ^T -> ^U) -> v:Vector<^T> -> Vector<^U>
Type parameters: ^T, ^U |
Creates a vector whose elements are the results of applying function |
mapi2(f v1 v2)
Signature: f:(int -> ^T1 -> ^T2 -> ^U) -> v1:Vector<^T1> -> v2:Vector<^T2> -> Vector<^U>
Type parameters: ^T1, ^T2, ^U |
Creates a vector whose elements are the results of applying function |
max(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Returns the maximum of all elements of vector |
maxBy(f v)
Signature: f:(^T -> 'U) -> v:Vector<^T> -> ^T
Type parameters: ^T, 'U |
Returns the maximum of all elements of vector |
min(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Returns the minimum of all elements of vector |
minBy(f v)
Signature: f:(^T -> 'U) -> v:Vector<^T> -> ^T
Type parameters: ^T, 'U |
Returns the minimum of all elements of vector |
norm(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the L2 (Euclidean) norm of vector |
normSq(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Gets the squared L2 (Euclidean) norm of vector |
ofArray(v)
Signature: v:^T [] -> Vector<^T>
Type parameters: ^T |
Createsa vector from array |
ofSeq(s)
Signature: s:seq<^T> -> Vector<^T>
Type parameters: ^T |
Creates a vector from sequence |
reduce(f v)
Signature: f:(^T -> ^T -> ^T) -> v:Vector<^T> -> ^T
Type parameters: ^T |
Applies function |
reduceBack(f v)
Signature: f:(^T -> ^T -> ^T) -> v:Vector<^T> -> ^T
Type parameters: ^T |
Applies function |
replace(f v)
Signature: f:(^T -> ^T) -> v:Vector<^T> -> unit
Type parameters: ^T |
Replaces the elements of vector |
replace2(f v1 v2)
Signature: f:(^T1 -> ^T2 -> ^T1) -> v1:Vector<^T1> -> v2:Vector<^T2> -> unit
Type parameters: ^T1, ^T2 |
Replaces the elements of vector |
replacei(f v)
Signature: f:(int -> ^T -> ^T) -> v:Vector<^T> -> unit
Type parameters: ^T |
Replaces the elements of vector |
replacei2(f v1 v2)
Signature: f:(int -> ^T1 -> ^T2 -> ^T1) -> v1:Vector<^T1> -> v2:Vector<^T2> -> unit
Type parameters: ^T1, ^T2 |
Replaces the elements of vector |
replaceWith(v1 v2)
Signature: v1:Vector<^T> -> v2:Vector<^T> -> unit
Type parameters: ^T |
Replaces the elements of vector |
scan(f s v)
Signature: f:(^S -> ^T -> ^S) -> s:^S -> v:Vector<^T> -> Vector<^S>
Type parameters: ^S, ^T |
Like Vector.fold, but returns the intermediate and final results |
scanBack(f s v)
Signature: f:(^T -> ^S -> ^S) -> s:^S -> v:Vector<^T> -> Vector<^S>
Type parameters: ^T, ^S |
Like Vector.foldBack, but returns both the intermediate and final results |
set(v i a)
Signature: v:Vector<^T> -> i:int -> a:^T -> unit
Type parameters: ^T |
Sets the element of vector |
split(n v)
Signature: n:seq<int> -> v:Vector<^T> -> seq<Vector<^T>>
Type parameters: ^T |
Returns a sequence of vectors that are obtained by splitting vector |
splitEqual(n v)
Signature: n:int -> v:Vector<^T> -> seq<Vector<^T>>
Type parameters: ^T |
Returns a sequence of vectors that are obtained by splitting vector |
standardBasis(n i)
Signature: n:int -> i:int -> Vector<^T>
Type parameters: ^T |
Creates a vector with |
sub(v s c)
Signature: v:Vector<^T> -> s:int -> c:int -> Vector<^T>
Type parameters: ^T |
Creates a new vector that contains the given subrange of vector |
sum(v)
Signature: v:Vector<^T> -> ^T
Type parameters: ^T |
Returns the sum of all the elements in vector |
sumBy(f v)
Signature: f:(^T -> ^U) -> v:Vector<^T> -> ^U
Type parameters: ^T, ^U |
Returns the sum of the results generated by applying function |
toArray(v)
Signature: v:Vector<^T> -> ^T []
Type parameters: ^T |
Converts vector |
toSeq(v)
Signature: v:Vector<^T> -> seq<^T>
Type parameters: ^T |
Returns vector |
unitVector(v)
Signature: v:Vector<^T> -> Vector<^T>
Type parameters: ^T |
Gets the unit vector codirectional with vector |