Mavryk_benchmark.Maths
Write-only matrices with elements indexed by pairs (column, row)
val vec_dim : vector -> int
Number of elements of a vector
val col_dim : matrix -> int
Number of columns of a matrix
val row_dim : matrix -> int
Number of rows of a matrix
val matrix_of_array_array : float array array -> matrix
Create a read-only matrix
overlay over an array of arrays. Note how we switch from row major to column major in order to comply to Linalg
's defaults.
val out_matrix_of_array_array : float array array -> out_matrix
Create a write-only overlay over an array of arrays. Note how we switch from row major to column major in order to comply to Linalg
's defaults.
val mm_ : out_matrix -> matrix -> matrix -> unit
mm_ out lhs rhs
computes the matrix product lhs x rhs
and stores it in out
val vector_to_array : vector -> float array
Create a float array
from a vector
val vector_of_array : float array -> vector
Create a vector
from a float array
val vector_to_seq : vector -> float Mavryk_base.TzPervasives.Seq.t
Construct a sequence out of the elements of a vector
Map a scalar function on the rows of a matrix, yielding a column vector
Map a scalar function on the rows of a matrix, yielding a column vector
Map a scalar function on the columns of a matrix, yielding a row vector
val empty_matrix : matrix
An empty matrix.
val l2_norm : vector -> float
l2 norm of a vector
val mse : vector -> float
Mean square error
val average : vector -> float
Average
val std : vector -> float
Standard deviation
val vector_encoding : vector Mavryk_base.TzPervasives.Data_encoding.t
An encoding for vectors.
val pp_vec : Stdlib.Format.formatter -> vector -> unit
Pretty printing vectors.