Page
Library
Module
Module type
Parameter
Class
Class type
Source
Lacaml_S.Mattype t = matval hilbert : int -> Lacaml_float32.mathilbert n
val hankel : int -> Lacaml_float32.mathankel n
val pascal : int -> Lacaml_float32.matpascal n
val rosser : unit -> Lacaml_float32.matrosser n
val toeplitz : Lacaml_float32.vec -> Lacaml_float32.mattoeplitz v
val vandermonde : Lacaml_float32.vec -> Lacaml_float32.matvandermonde v
val wilkinson : int -> Lacaml_float32.matwilkinson n
val random :
?rnd_state:Random.State.t ->
?from:float ->
?range:float ->
int ->
int ->
Lacaml_float32.matrandom ?rnd_state ?from ?range m n
val sqr : Lacaml_float32.Types.Mat.unopsqr ?m ?n ?br ?bc ?b ?ar ?ac a computes the square of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val sqrt : Lacaml_float32.Types.Mat.unopsqrt ?m ?n ?br ?bc ?b ?ar ?ac a computes the square root of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val exp : Lacaml_float32.Types.Mat.unopexp ?m ?n ?br ?bc ?b ?ar ?ac a computes the exponential of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val log : Lacaml_float32.Types.Mat.unoplog ?m ?n ?br ?bc ?b ?ar ?ac a computes the logarithm of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val sin : Lacaml_float32.Types.Mat.unopsin ?m ?n ?br ?bc ?b ?ar ?ac a computes the sine of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val cos : Lacaml_float32.Types.Mat.unopcos ?m ?n ?br ?bc ?b ?ar ?ac a computes the cosine of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val tan : Lacaml_float32.Types.Mat.unoptan ?m ?n ?br ?bc ?b ?ar ?ac a computes the tangent of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val tanh : Lacaml_float32.Types.Mat.unoptanh ?m ?n ?br ?bc ?b ?ar ?ac a computes the hyperbolic tangent of the elements in the m by n sub-matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val cpab :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
unitcpab ?m ?n ?cr ?cc c ?ar ?ac a ?br ?bc b multiplies designated m-by-n range of elements of matrices a and b elementwise, and adds the result to and stores it in the specified range in c. This function is useful for convolutions. Similar to Vec.zpxy.
val cmab :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
unitcmab ?m ?n ?cr ?cc c ?ar ?ac a ?br ?bc b multiplies designated m-by-n range of elements of matrices a and b elementwise, and subtracts the result from and stores it in the specified range in c. This function is useful for convolutions. Similar to Vec.zmxy.
val create : int -> int -> Lacaml_float32.matcreate m n
val make : int -> int -> Lacaml_float32.num_type -> Lacaml_float32.matmake m n x
val make0 : int -> int -> Lacaml_float32.matmake0 m n x
val of_array : Lacaml_float32.num_type array array -> Lacaml_float32.matof_array ar
val to_array : Lacaml_float32.mat -> Lacaml_float32.num_type array arrayto_array mat
val of_list : Lacaml_float32.num_type list list -> Lacaml_float32.matof_list ls
val to_list : Lacaml_float32.mat -> Lacaml_float32.num_type list listto_array mat
val of_col_vecs : Lacaml_float32.vec array -> Lacaml_float32.matof_col_vecs ar
val to_col_vecs : Lacaml_float32.mat -> Lacaml_float32.vec arrayto_col_vecs mat
val of_col_vecs_list : Lacaml_float32.vec list -> Lacaml_float32.matof_col_vecs_list ar
val to_col_vecs_list : Lacaml_float32.mat -> Lacaml_float32.vec listto_col_vecs_list mat
val as_vec : Lacaml_float32.mat -> Lacaml_float32.vecas_vec mat
val init_rows :
int ->
int ->
(int -> int -> Lacaml_float32.num_type) ->
Lacaml_float32.matinit_cols m n f
val init_cols :
int ->
int ->
(int -> int -> Lacaml_float32.num_type) ->
Lacaml_float32.matinit_cols m n f
val create_mvec : int -> Lacaml_float32.matcreate_mvec m
val make_mvec : int -> Lacaml_float32.num_type -> Lacaml_float32.matmake_mvec m x
val mvec_of_array : Lacaml_float32.num_type array -> Lacaml_float32.matmvec_of_array ar
val mvec_to_array : Lacaml_float32.mat -> Lacaml_float32.num_type arraymvec_to_array mat
val from_col_vec : Lacaml_float32.vec -> Lacaml_float32.matfrom_col_vec v
val from_row_vec : Lacaml_float32.vec -> Lacaml_float32.matfrom_row_vec v
val empty : Lacaml_float32.matempty, the empty matrix.
val identity : int -> Lacaml_float32.matidentity n
val of_diag :
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float32.mat ->
?ofsx:int ->
?incx:int ->
Lacaml_float32.vec ->
Lacaml_float32.matof_diag ?n ?br ?bc ?b ?ofsx ?incx x
val dim1 : Lacaml_float32.mat -> intdim1 m
val dim2 : Lacaml_float32.mat -> intdim2 m
val col : Lacaml_float32.mat -> int -> Lacaml_float32.veccol m n
val copy_row :
?vec:Lacaml_float32.vec ->
Lacaml_float32.mat ->
int ->
Lacaml_float32.veccopy_row ?vec mat int
val swap :
?uplo:[ `U | `L ] ->
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
unitswap ?m ?n ?ar ?ac a ?br ?bc b swaps the contents of (sub-matrices) a and b.
val transpose_copy : Lacaml_float32.Types.Mat.unoptranspose_copy ?m ?n ?br ?bc ?b ?ar ?ac a
val detri :
?up:bool ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
unitdetri ?up ?n ?ar ?ac a takes a triangular (sub-)matrix a, i.e. one where only the upper (iff up is true) or lower triangle is defined, and makes it a symmetric matrix by mirroring the defined triangle along the diagonal.
val packed :
?up:bool ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.vecpacked ?up ?n ?ar ?ac a
val unpacked : ?up:bool -> ?n:int -> Lacaml_float32.vec -> Lacaml_float32.matunpacked ?up x
val fill :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_type ->
unitfill ?m ?n ?ar ?ac a x fills the specified sub-matrix in a with value x.
val sum :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_typesum ?m ?n ?ar ?ac a computes the sum of all elements in the m-by-n submatrix starting at row ar and column ac.
val add_const :
Lacaml_float32.num_type ->
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.matadd_const c ?m ?n ?br ?bc ?b ?ar ?ac a adds constant c to the designated m by n submatrix in a and stores the result in the designated submatrix in b.
val neg :
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.matneg ?m ?n ?br ?bc ?b ?ar ?ac a computes the negative of the elements in the m by n (sub-)matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val reci :
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.matreci ?m ?n ?br ?bc ?b ?ar ?ac a computes the reciprocal of the elements in the m by n (sub-)matrix of the matrix a starting in row ar and column ac. If b is given, the result will be stored in there using offsets br and bc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val copy_diag :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float32.vec ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.veccopy_diag ?n ?ofsy ?incy ?y ?ar ?ac a
val trace : Lacaml_float32.mat -> Lacaml_float32.num_typetrace m
val scal :
?m:int ->
?n:int ->
Lacaml_float32.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
unitscal ?m ?n alpha ?ar ?ac a BLAS scal function for (sub-)matrices.
val scal_cols :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?ofs:int ->
Lacaml_float32.vec ->
unitscal_cols ?m ?n ?ar ?ac a ?ofs alphas column-wise scal function for matrices.
val scal_rows :
?m:int ->
?n:int ->
?ofs:int ->
Lacaml_float32.vec ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
unitscal_rows ?m ?n ?ofs alphas ?ar ?ac a row-wise scal function for matrices.
val syrk_trace :
?n:int ->
?k:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_typesyrk_trace ?n ?k ?ar ?ac a computes the trace of either a' * a or a * a', whichever is more efficient (results are identical), of the (sub-)matrix a multiplied by its own transpose. This is the same as the square of the Frobenius norm of a matrix. n is the number of rows to consider in a, and k the number of columns to consider.
val syrk_diag :
?n:int ->
?k:int ->
?beta:Lacaml_float32.num_type ->
?ofsy:int ->
?y:Lacaml_float32.vec ->
?trans:Lacaml_common.trans2 ->
?alpha:Lacaml_float32.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.vecsyrk_diag ?n ?k ?beta ?ofsy ?y ?trans ?alpha ?ar ?ac a computes the diagonal of the symmetric rank-k product of the (sub-)matrix a, multiplying it with alpha and adding beta times y, storing the result in y starting at the specified offset. n elements of the diagonal will be computed, and k elements of the matrix will be part of the dot product associated with each diagonal element.
val add :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
?c:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.matadd ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b computes the sum of the m by n sub-matrix of the matrix a starting in row ar and column ac with the corresponding sub-matrix of the matrix b starting in row br and column bc. If c is given, the result will be stored in there starting in row cr and column cc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val sub :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
?c:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.matsub ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b computes the difference of the m by n sub-matrix of the matrix a starting in row ar and column ac with the corresponding sub-matrix of the matrix b starting in row br and column bc. If c is given, the result will be stored in there starting in row cr and column cc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val mul :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
?c:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.matmul ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b computes the product of the m by n sub-matrix of the matrix a starting in row ar and column ac with the corresponding sub-matrix of the matrix b starting in row br and column bc. If c is given, the result will be stored in there starting in row cr and column cc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val div :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
?c:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.matdiv ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b computes the division of the m by n sub-matrix of the matrix a starting in row ar and column ac with the corresponding sub-matrix of the matrix b starting in row br and column bc. If c is given, the result will be stored in there starting in row cr and column cc, otherwise a fresh matrix will be used. The resulting matrix is returned.
val axpy :
?alpha:Lacaml_float32.num_type ->
?m:int ->
?n:int ->
?xr:int ->
?xc:int ->
Lacaml_float32.mat ->
?yr:int ->
?yc:int ->
Lacaml_float32.mat ->
unitaxpy ?alpha ?m ?n ?xr ?xc x ?yr ?yc y BLAS axpy function for matrices.
val gemm_diag :
?n:int ->
?k:int ->
?beta:Lacaml_float32.num_type ->
?ofsy:int ->
?y:Lacaml_float32.vec ->
?transa:Lacaml_float32.trans3 ->
?alpha:Lacaml_float32.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?transb:Lacaml_float32.trans3 ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.vecgemm_diag ?n ?k ?beta ?ofsy ?y ?transa ?transb ?alpha ?ar ?ac a ?br ?bc b computes the diagonal of the product of the (sub-)matrices a and b (taking into account potential transposing), multiplying it with alpha and adding beta times y, storing the result in y starting at the specified offset. n elements of the diagonal will be computed, and k elements of the matrices will be part of the dot product associated with each diagonal element.
val gemm_trace :
?n:int ->
?k:int ->
?transa:Lacaml_float32.trans3 ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?transb:Lacaml_float32.trans3 ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_typegemm_trace ?n ?k ?transa ?ar ?ac a ?transb ?br ?bc b computes the trace of the product of the (sub-)matrices a and b (taking into account potential transposing). This is also sometimes referred to as the Frobenius product. n is the number of rows (columns) to consider in a, and k the number of columns (rows) in b.
val symm2_trace :
?n:int ->
?upa:bool ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?upb:bool ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_typesymm2_trace ?n ?upa ?ar ?ac a ?upb ?br ?bc b computes the trace of the product of the symmetric (sub-)matrices a and b. n is the number of rows and columns to consider in a and b.
val ssqr_diff :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
?br:int ->
?bc:int ->
Lacaml_float32.mat ->
Lacaml_float32.num_typessqr_diff ?m ?n ?ar ?ac a ?br ?bc b
val map :
(Lacaml_float32.num_type -> Lacaml_float32.num_type) ->
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float32.mat ->
?ar:int ->
?ac:int ->
Lacaml_float32.mat ->
Lacaml_float32.matmap f ?m ?n ?br ?bc ?b ?ar ?ac a
val fold_cols :
('a -> Lacaml_float32.vec -> 'a) ->
?n:int ->
?ac:int ->
'a ->
Lacaml_float32.mat ->
'afold_cols f ?n ?ac acc a