FSharpPlus


Vector Module

Namespace: FSharpPlus.Data

Assembly: FSharpPlus.dll

Functions and values

Function or value Description

allPairs v1 v2

Full Usage: allPairs v1 v2

Parameters:
Returns: Vector<('a * 'b), 'm*'n>

v1 : Vector<'a, ^m>
v2 : Vector<'b, ^n>
Returns: Vector<('a * 'b), 'm*'n>

append v1 v2

Full Usage: append v1 v2

Parameters:
Returns: Vector<'a, ^n1+^n2>

v1 : Vector<'a, ^n1>
v2 : Vector<'a, ^n2>
Returns: Vector<'a, ^n1+^n2>

apply f v

Full Usage: apply f v

Parameters:
Returns: Vector<'b, 'n>

f : Vector<('a -> 'b), 'n>
v : Vector<'a, 'n>
Returns: Vector<'b, 'n>

chunkBySize n v

Full Usage: chunkBySize n v

Parameters:
    n : ^n
    v : Vector<'a, ^k*'n>

Returns: Vector<Vector<'a, ^n>, ^k>

You can also use `Vector.ChunkBySize.Invoke v`.

n : ^n
v : Vector<'a, ^k*'n>
Returns: Vector<Vector<'a, ^n>, ^k>

concat vv

Full Usage: concat vv

Parameters:
Returns: Vector<'a, 'm*'n>

vv : Vector<Vector<'a, ^m>, ^n>
Returns: Vector<'a, 'm*'n>

create definition

Full Usage: create definition

Parameters:
    definition : ^a*'a*..*'a

Returns: Vector<'a, 'n>

definition : ^a*'a*..*'a
Returns: Vector<'a, 'n>

directProduct v1 v2

Full Usage: directProduct v1 v2

Parameters:
Returns: Matrix<^a, ^m, ^n>

v1 : Vector<^a, ^m>
v2 : Vector<^a, ^n>
Returns: Matrix<^a, ^m, ^n>

empty

Full Usage: empty

Returns: Vector<'a, Z>

Returns: Vector<'a, Z>

exists p v

Full Usage: exists p v

Parameters:
    p : 'a -> bool
    v : Vector<'a, 'n>

Returns: bool

p : 'a -> bool
v : Vector<'a, 'n>
Returns: bool

exists2 p v1 v2

Full Usage: exists2 p v1 v2

Parameters:
    p : 'a -> 'b -> bool
    v1 : Vector<'a, 'n>
    v2 : Vector<'b, 'n>

Returns: bool

p : 'a -> 'b -> bool
v1 : Vector<'a, 'n>
v2 : Vector<'b, 'n>
Returns: bool

fold f state v

Full Usage: fold f state v

Parameters:
    f : 'State -> 'a -> 'State
    state : 'State
    v : Vector<'a, 'n>

Returns: 'State

f : 'State -> 'a -> 'State
state : 'State
v : Vector<'a, 'n>
Returns: 'State

fold2 f state v1 v2

Full Usage: fold2 f state v1 v2

Parameters:
    f : 'State -> 'a -> 'b -> 'State
    state : 'State
    v1 : Vector<'a, 'n>
    v2 : Vector<'b, 'n>

Returns: 'State

f : 'State -> 'a -> 'b -> 'State
state : 'State
v1 : Vector<'a, 'n>
v2 : Vector<'b, 'n>
Returns: 'State

foldBack f v state

Full Usage: foldBack f v state

Parameters:
    f : 'a -> 'State -> 'State
    v : Vector<'a, 'n>
    state : 'State

Returns: 'State

f : 'a -> 'State -> 'State
v : Vector<'a, 'n>
state : 'State
Returns: 'State

foldBack2 f v1 v2 state

Full Usage: foldBack2 f v1 v2 state

Parameters:
    f : 'a -> 'b -> 'State -> 'State
    v1 : Vector<'a, 'n>
    v2 : Vector<'b, 'n>
    state : 'State

Returns: 'State

f : 'a -> 'b -> 'State -> 'State
v1 : Vector<'a, 'n>
v2 : Vector<'b, 'n>
state : 'State
Returns: 'State

forall p v

Full Usage: forall p v

Parameters:
    p : 'a -> bool
    v : Vector<'a, 'n>

Returns: bool

p : 'a -> bool
v : Vector<'a, 'n>
Returns: bool

forall2 p v1 v2

Full Usage: forall2 p v1 v2

Parameters:
    p : 'a -> 'b -> bool
    v1 : Vector<'a, 'n>
    v2 : Vector<'b, 'n>

Returns: bool

p : 'a -> 'b -> bool
v1 : Vector<'a, 'n>
v2 : Vector<'b, 'n>
Returns: bool

get index vec

Full Usage: get index vec

Parameters:
    index : ^iwhen^i<^n
    vec : Vector<'a, ^n>

Returns: 'a

You can also use `Vector.Get.Invoke vec`.

index : ^iwhen^i<^n
vec : Vector<'a, ^n>
Returns: 'a

head v

Full Usage: head v

Parameters:
Returns: 'a

v : Vector<'a, S<'b>>
Returns: 'a

indexed v

Full Usage: indexed v

Parameters:
Returns: Vector<(int * 'a), 'n>

v : Vector<'a, 'n>
Returns: Vector<(int * 'a), 'n>

init n f

Full Usage: init n f

Parameters:
    n : ^n
    f : int -> 'a

Returns: Vector<'a, ^n>

You can also use `Vector.Init.Invoke f`.

n : ^n
f : int -> 'a
Returns: Vector<'a, ^n>

innerProduct v1 v2

Full Usage: innerProduct v1 v2

Parameters:
Returns: ^c

v1 : Vector<^a, S<'n>>
v2 : Vector<^b, S<'n>>
Returns: ^c

iter f vec

Full Usage: iter f vec

Parameters:
    f : 'a -> unit
    vec : Vector<'a, 'n>

f : 'a -> unit
vec : Vector<'a, 'n>

iter2 f vec1 vec2

Full Usage: iter2 f vec1 vec2

Parameters:
    f : 'a -> 'b -> unit
    vec1 : Vector<'a, 'n>
    vec2 : Vector<'b, 'n>

f : 'a -> 'b -> unit
vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>

iteri2 f vec1 vec2

Full Usage: iteri2 f vec1 vec2

Parameters:
    f : int -> 'a -> 'b -> unit
    vec1 : Vector<'a, 'n>
    vec2 : Vector<'b, 'n>

f : int -> 'a -> 'b -> unit
vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>

last v

Full Usage: last v

Parameters:
Returns: 'a

v : Vector<'a, S<'b>>
Returns: 'a

length arg1

Full Usage: length arg1

Parameters:
Returns: ^n

arg0 : Vector<'a, ^n>
Returns: ^n

length' arg1

Full Usage: length' arg1

Parameters:
Returns: int

arg0 : Vector<'a, ^n>
Returns: int

map f vec

Full Usage: map f vec

Parameters:
    f : 'a -> 'b
    vec : Vector<'a, 'n>

Returns: Vector<'b, 'n>

f : 'a -> 'b
vec : Vector<'a, 'n>
Returns: Vector<'b, 'n>

map2 f vec1 vec2

Full Usage: map2 f vec1 vec2

Parameters:
    f : 'a -> 'b -> 'c
    vec1 : Vector<'a, 'n>
    vec2 : Vector<'b, 'n>

Returns: Vector<'c, 'n>

f : 'a -> 'b -> 'c
vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>
Returns: Vector<'c, 'n>

map3 f vec1 vec2 vec3

Full Usage: map3 f vec1 vec2 vec3

Parameters:
    f : 'a -> 'b -> 'c -> 'd
    vec1 : Vector<'a, 'n>
    vec2 : Vector<'b, 'n>
    vec3 : Vector<'c, 'n>

Returns: Vector<'d, 'n>

f : 'a -> 'b -> 'c -> 'd
vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>
vec3 : Vector<'c, 'n>
Returns: Vector<'d, 'n>

mapFold f state v

Full Usage: mapFold f state v

Parameters:
    f : 'State -> 'a -> 'b * 'State
    state : 'State
    v : Vector<'a, ^n>

Returns: Vector<'b, ^n> * 'State

f : 'State -> 'a -> 'b * 'State
state : 'State
v : Vector<'a, ^n>
Returns: Vector<'b, ^n> * 'State

mapFoldBack f v state

Full Usage: mapFoldBack f v state

Parameters:
    f : 'a -> 'State -> 'b * 'State
    v : Vector<'a, ^n>
    state : 'State

Returns: Vector<'b, ^n> * 'State

f : 'a -> 'State -> 'b * 'State
v : Vector<'a, ^n>
state : 'State
Returns: Vector<'b, ^n> * 'State

mapi f vec

Full Usage: mapi f vec

Parameters:
    f : int -> 'a -> 'b
    vec : Vector<'a, 'n>

Returns: Vector<'b, 'n>

f : int -> 'a -> 'b
vec : Vector<'a, 'n>
Returns: Vector<'b, 'n>

mapi2 f vec1 vec2

Full Usage: mapi2 f vec1 vec2

Parameters:
    f : int -> 'a -> 'b -> 'c
    vec1 : Vector<'a, 'n>
    vec2 : Vector<'b, 'n>

Returns: Vector<'c, 'n>

f : int -> 'a -> 'b -> 'c
vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>
Returns: Vector<'c, 'n>

maximumNorm v

Full Usage: maximumNorm v

Parameters:
Returns: ^a

v : Vector<^a, ^n>
Returns: ^a

norm v

Full Usage: norm v

Parameters:
Returns: ^a

v : Vector<^a, ^n>
Returns: ^a

normalize v

Full Usage: normalize v

Parameters:
Returns: Vector<^a, ^n>

v : Vector<^a, ^n>
Returns: Vector<^a, ^n>

pNorm p v

Full Usage: pNorm p v

Parameters:
Returns: ^a

p : ^a
v : Vector<^a, ^n>
Returns: ^a

pairwise v

Full Usage: pairwise v

Parameters:
Returns: Vector<('a * 'a), 'n-1>

v : Vector<'a, ^n>
Returns: Vector<('a * 'a), 'n-1>

permute f v

Full Usage: permute f v

Parameters:
    f : int -> int
    v : Vector<'a, 'n>

Returns: Vector<'a, 'n>

f : int -> int
v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

replicate n value

Full Usage: replicate n value

Parameters:
    n : ^n
    value : 'a

Returns: Vector<'a, ^n>

You can also use `Vector.Replicate.Invoke value`.

n : ^n
value : 'a
Returns: Vector<'a, ^n>

rev v

Full Usage: rev v

Parameters:
Returns: Vector<'a, 'n>

v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

singleton x

Full Usage: singleton x

Parameters:
    x : 'a

Returns: Vector<'a, S<Z>>

x : 'a
Returns: Vector<'a, S<Z>>

skip n v

Full Usage: skip n v

Parameters:
    n : ^nwhen'n<='m
    v : Vector<'a, ^m>

Returns: Vector<'a, ^m-'n>

You can also use `Vector.Skip.Invoke v`.

n : ^nwhen'n<='m
v : Vector<'a, ^m>
Returns: Vector<'a, ^m-'n>

slice startIndex endIndex v

Full Usage: slice startIndex endIndex v

Parameters:
    startIndex : ^iwhen^i<^n
    endIndex : ^jwhen^i<=^j<^n
    v : Vector<'a, ^n>

Returns: Vector<'a, S<^j-^i>>

You can also use `Vector.Slice.Invoke v`.

startIndex : ^iwhen^i<^n
endIndex : ^jwhen^i<=^j<^n
v : Vector<'a, ^n>
Returns: Vector<'a, S<^j-^i>>

sort v

Full Usage: sort v

Parameters:
Returns: Vector<'a, 'n>

v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

sortBy f v

Full Usage: sortBy f v

Parameters:
    f : 'a -> 'b
    v : Vector<'a, 'n>

Returns: Vector<'a, 'n>

f : 'a -> 'b
v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

sortByDescending f v

Full Usage: sortByDescending f v

Parameters:
    f : 'a -> 'b
    v : Vector<'a, 'n>

Returns: Vector<'a, 'n>

f : 'a -> 'b
v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

sortDescending v

Full Usage: sortDescending v

Parameters:
Returns: Vector<'a, 'n>

v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

sortWith f v

Full Usage: sortWith f v

Parameters:
    f : 'a -> 'a -> int
    v : Vector<'a, 'n>

Returns: Vector<'a, 'n>

f : 'a -> 'a -> int
v : Vector<'a, 'n>
Returns: Vector<'a, 'n>

splitInto n v

Full Usage: splitInto n v

Parameters:
    n : ^n
    v : Vector<'a, ^n*'k>

Returns: Vector<Vector<'a, ^k>, ^n>

You can also use `Vector.SplitInto.Invoke v`.

n : ^n
v : Vector<'a, ^n*'k>
Returns: Vector<Vector<'a, ^k>, ^n>

tail v

Full Usage: tail v

Parameters:
Returns: Vector<'a, 'n>

v : Vector<'a, S<'n>>
Returns: Vector<'a, 'n>

take n v

Full Usage: take n v

Parameters:
    n : ^n
    v : Vector<'a, ^mwhen'm>='n>

Returns: Vector<'a, ^n>

You can also use `Vector.Take.Invoke v`.

n : ^n
v : Vector<'a, ^mwhen'm>='n>
Returns: Vector<'a, ^n>

toArray vec

Full Usage: toArray vec

Parameters:
Returns: 'a[]

vec : Vector<'a, 'n>
Returns: 'a[]

toCol v

Full Usage: toCol v

Parameters:
Returns: Matrix<'a, 'n, S<Z>>

v : Vector<'a, 'n>
Returns: Matrix<'a, 'n, S<Z>>

toList vec

Full Usage: toList vec

Parameters:
Returns: 'a list

vec : Vector<'a, 'n>
Returns: 'a list

toRow v

Full Usage: toRow v

Parameters:
Returns: Matrix<'a, S<Z>, 'n>

v : Vector<'a, 'n>
Returns: Matrix<'a, S<Z>, 'n>

toSeq vec

Full Usage: toSeq vec

Parameters:
Returns: seq<'a>

vec : Vector<'a, 'n>
Returns: seq<'a>

tryOfArray length xs

Full Usage: tryOfArray length xs

Parameters:
    length : ^n
    xs : 'a[]

Returns: Vector<'a, ^n> option

Tries to create a vector of length `n`. If the length of `xs` does not match, it will return `None`. Otherwise, it will return the vector with `Some`. You can also use `Vector.TryCreate.OfArray xs`.

length : ^n
xs : 'a[]
Returns: Vector<'a, ^n> option

tryOfList length xs

Full Usage: tryOfList length xs

Parameters:
    length : ^n
    xs : 'a list

Returns: Vector<'a, ^n> option

Tries to create a vector of length `n`. If the length of `xs` does not match, it will return `None`. Otherwise, it will return the vector with `Some`. You can also use `Vector.TryCreate.OfList xs`.

length : ^n
xs : 'a list
Returns: Vector<'a, ^n> option

tryOfSeq length xs

Full Usage: tryOfSeq length xs

Parameters:
    length : ^n
    xs : seq<'a>

Returns: Vector<'a, ^n> option

Tries to create a vector of length `n`. If the length of `xs` does not match, it will return `None`. Otherwise, it will return the vector with `Some`. You can also use `Vector.TryCreate.OfSeq xs`.

length : ^n
xs : seq<'a>
Returns: Vector<'a, ^n> option

unsafeCreate _length xs

Full Usage: unsafeCreate _length xs

Parameters:
    _length : 'n
    xs : 'a[]

Returns: Vector<'a, 'n>

_length : 'n
xs : 'a[]
Returns: Vector<'a, 'n>

unsafeGet index vec

Full Usage: unsafeGet index vec

Parameters:
    index : int
    vec : Vector<'a, 'n>

Returns: 'a

index : int
vec : Vector<'a, 'n>
Returns: 'a

unzip vec

Full Usage: unzip vec

Parameters:
Returns: Vector<'a, 'n> * Vector<'b, 'n>

vec : Vector<('a * 'b), 'n>
Returns: Vector<'a, 'n> * Vector<'b, 'n>

unzip3 vec

Full Usage: unzip3 vec

Parameters:
    vec : Vector<('a * 'b * 'c), 'n>

Returns: Vector<'a, 'n> * Vector<'b, 'n> * Vector<'c, 'n>

vec : Vector<('a * 'b * 'c), 'n>
Returns: Vector<'a, 'n> * Vector<'b, 'n> * Vector<'c, 'n>

vectorProduct3 v1 v2

Full Usage: vectorProduct3 v1 v2

Parameters:
Returns: Vector<^d, S<S<S<Z>>>>

v1 : Vector<^a, S<S<S<Z>>>>
v2 : Vector<^b, S<S<S<Z>>>>
Returns: Vector<^d, S<S<S<Z>>>>

windowed m v

Full Usage: windowed m v

Parameters:
Returns: Vector<Vector<'a, ^m>, S<'n-'m>>

You can also use `Vector.Windowed.Invoke v`.

m : ^m
v : Vector<'a, ^n>
Returns: Vector<Vector<'a, ^m>, S<'n-'m>>

zero

Full Usage: zero

Returns: Vector<^a, ^m>

Returns: Vector<^a, ^m>

zeroCreate n

Full Usage: zeroCreate n

Parameters:
    n : ^n

Returns: Vector<'a, ^n>

You can also use `Vector.ZeroCreate.Invoke()`.

n : ^n
Returns: Vector<'a, ^n>

zip vec1 vec2

Full Usage: zip vec1 vec2

Parameters:
Returns: Vector<('a * 'b), 'n>

vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>
Returns: Vector<('a * 'b), 'n>

zip3 vec1 vec2 vec3

Full Usage: zip3 vec1 vec2 vec3

Parameters:
Returns: Vector<('a * 'b * 'c), 'n>

vec1 : Vector<'a, 'n>
vec2 : Vector<'b, 'n>
vec3 : Vector<'c, 'n>
Returns: Vector<('a * 'b * 'c), 'n>