proc rowVec[N: static[int]](arr: Array[N]): RowVector[N]
-
Create a new row vector, takes an array of floats
Source
Edit
proc colVec[N: static[int]](arr: Array[N]): ColVector[N]
-
Create a new row vector, takes an array of floats
Source
Edit
proc toRow[N: static[int]](arr: Array[N]): RowVector[N] {.inline
.}
-
Create a new row vector, takes an array of floats
Source
Edit
proc toCol[N: static[int]](arr: Array[N]): ColVector[N] {.inline
.}
-
Create a new row vector, takes an array of floats
Source
Edit
proc len[N: static[int]](v: Vector[N]): int
-
The length of the vector. Read only.
Source
Edit
proc `[]`[N: static[int]](v: Vector[N]; i: int): float {.inline
.}
-
Source
Edit
proc `[]=`[N: static[int]](v: Vector[N]; i: int; val: float) {.inline
.}
-
Source
Edit
proc eq[N: static[int]](v, w: Vector[N]; epsilon: float = Epsilon): bool
-
Equal up to epsilon
Source
Edit
proc `==`[N: static[int]](v, w: Vector[N]; epsilon = Epsilon): bool {.inline
.}
-
Source
Edit
proc `===`[N: static[int]](v, w: Vector[N]): bool
-
Exact equality.
Source
Edit
proc `$`[N: static[int]](v: ColVector[N]): string
-
Source
Edit
proc `$`[N: static[int]](v: RowVector[N]): string
-
Source
Edit
proc low(v: ColVector): int
-
Source
Edit
proc high(v: ColVector): int
-
Source
Edit
proc low(v: RowVector): int
-
Source
Edit
proc high(v: RowVector): int
-
Source
Edit
proc t[N: static[int]](v: ColVector[N]): RowVector[N]
-
Transpose the vector ( col -> row )
Source
Edit
proc t[N: static[int]](v: RowVector[N]): ColVector[N]
-
Transpose the vector ( row -> col )
Source
Edit
proc pnorm[N: static[int]](v: Vector[N]; p: Natural = 1): float
-
P norm: |v| = p-root(sum ( |x_i|^p) )
Source
Edit
proc enorm[N: static[int]](v: Vector[N]): float
-
Euclidean norm: |v| = sqrt(sum ( |x_i|^2) )
Source
Edit
proc norm[N: static[int]](v: Vector[N]): float
-
Infinite norm: |v| = max_i of |x_i|
Source
Edit
proc dot[N: static[int]](v, w: Vector[N]): float
-
Vector dot product. Can use openblas.
Source
Edit
proc dot[N: static[int]](v: RowVector[N]; w: ColVector[N]): float
-
Vector dot product. Can use openblas.
Source
Edit
proc `*`[N: static[int]](v, w: Vector[N]): float {.inline
.}
-
shorthand for dot
Source
Edit
proc `*`[N: static[int]](v: RowVector[N]; w: ColVector[N]): float
-
shorthand for dot
Source
Edit
proc add[N: static[int]](v, w: Vector[N]): Vector[N]
-
Source
Edit
proc `+`[N: static[int]](v: Vector[N]; w: Vector[N]): auto {.inline
.}
-
shorthand to add
Source
Edit
proc sub[N: static[int]](v, w: Vector[N]): Vector[N]
-
Subtract two vectors.
Source
Edit
proc `-`[N: static[int]](v: Vector[N]; w: Vector[N]): auto {.inline
.}
-
shorthand to sub
Source
Edit
proc `*`[N: static[int]](a: float64; v: Vector[N]): Vector[N]
-
scalar times vector. Can use openblas
Source
Edit
proc `.*`[N: static[int]](v, w: Vector[N]): Vector[N]
-
Elementwise vector product.
Source
Edit
proc `/`[N: static[int]](v: Vector[N]; val: float): Vector[N]
-
Vector divided by val
Source
Edit
proc `./`[N: static[int]](v, w: Vector[N]): Vector[N]
-
Vector elementwise division
Source
Edit
proc rowones(N: static[int]): RowVector[N]
-
Construct a vector of N 1s
Source
Edit
proc rowzeros(N: static[int]): RowVector[N]
-
Construct a vector of N 0s
Source
Edit