Library
Module
Module type
Parameter
Class
Class type
type t = mat
val hilbert : int -> Lacaml_float64.mat
hilbert n
val hankel : int -> Lacaml_float64.mat
hankel n
val pascal : int -> Lacaml_float64.mat
pascal n
val rosser : unit -> Lacaml_float64.mat
rosser n
val toeplitz : Lacaml_float64.vec -> Lacaml_float64.mat
toeplitz v
val vandermonde : Lacaml_float64.vec -> Lacaml_float64.mat
vandermonde v
val wilkinson : int -> Lacaml_float64.mat
wilkinson n
val random :
?rnd_state:Random.State.t ->
?from:float ->
?range:float ->
int ->
int ->
Lacaml_float64.mat
random ?rnd_state ?from ?range m n
val abs : Lacaml_float64.Types.Mat.unop
abs ?m ?n ?br ?bc ?b ?ar ?ac a
computes the absolute value 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 signum : Lacaml_float64.Types.Mat.unop
signum ?m ?n ?br ?bc ?b ?ar ?ac a
computes the sign value (-1
for negative numbers, 0
(or -0
) for zero, 1
for positive numbers, nan
for nan
) 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 sqr : Lacaml_float64.Types.Mat.unop
sqr ?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_float64.Types.Mat.unop
sqrt ?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 cbrt : Lacaml_float64.Types.Mat.unop
cbrt ?m ?n ?br ?bc ?b ?ar ?ac a
computes the cubic 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_float64.Types.Mat.unop
exp ?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 exp2 : Lacaml_float64.Types.Mat.unop
exp2 ?m ?n ?br ?bc ?b ?ar ?ac a
computes the base-2 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 expm1 : Lacaml_float64.Types.Mat.unop
expm1 ?m ?n ?br ?bc ?b ?ar ?ac a
computes exp a -. 1.
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_float64.Types.Mat.unop
log ?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 log10 : Lacaml_float64.Types.Mat.unop
log10 ?m ?n ?br ?bc ?b ?ar ?ac a
computes the base-10 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 log2 : Lacaml_float64.Types.Mat.unop
log2 ?m ?n ?br ?bc ?b ?ar ?ac a
computes base-2 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 log1p : Lacaml_float64.Types.Mat.unop
log1p ?m ?n ?br ?bc ?b ?ar ?ac a
computes log (1 + a)
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_float64.Types.Mat.unop
sin ?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_float64.Types.Mat.unop
cos ?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_float64.Types.Mat.unop
tan ?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 asin : Lacaml_float64.Types.Mat.unop
asin ?m ?n ?br ?bc ?b ?ar ?ac a
computes the arc 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 acos : Lacaml_float64.Types.Mat.unop
acos ?m ?n ?br ?bc ?b ?ar ?ac a
computes the arc 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 atan : Lacaml_float64.Types.Mat.unop
atan ?m ?n ?br ?bc ?b ?ar ?ac a
computes the arc 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 sinh : Lacaml_float64.Types.Mat.unop
sinh ?m ?n ?br ?bc ?b ?ar ?ac a
computes the hyperbolic 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 cosh : Lacaml_float64.Types.Mat.unop
cosh ?m ?n ?br ?bc ?b ?ar ?ac a
computes the hyperbolic 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 tanh : Lacaml_float64.Types.Mat.unop
tanh ?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 asinh : Lacaml_float64.Types.Mat.unop
asinh ?m ?n ?br ?bc ?b ?ar ?ac a
computes the hyperbolic arc 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 acosh : Lacaml_float64.Types.Mat.unop
acosh ?m ?n ?br ?bc ?b ?ar ?ac a
computes the hyperbolic arc 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 atanh : Lacaml_float64.Types.Mat.unop
atanh ?m ?n ?br ?bc ?b ?ar ?ac a
computes the hyperbolic arc 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 floor : Lacaml_float64.Types.Mat.unop
floor ?m ?n ?br ?bc ?b ?ar ?ac a
computes the floor 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 ceil : Lacaml_float64.Types.Mat.unop
ceil ?m ?n ?br ?bc ?b ?ar ?ac a
computes the ceiling 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 round : Lacaml_float64.Types.Mat.unop
round ?m ?n ?br ?bc ?b ?ar ?ac a
rounds 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 trunc : Lacaml_float64.Types.Mat.unop
trunc ?m ?n ?br ?bc ?b ?ar ?ac a
computes the truncation 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 erf : Lacaml_float64.Types.Mat.unop
erf ?m ?n ?br ?bc ?b ?ar ?ac a
computes the error function 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 erfc : Lacaml_float64.Types.Mat.unop
erfc ?m ?n ?br ?bc ?b ?ar ?ac a
computes the complementary error function 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 logistic : Lacaml_float64.Types.Mat.unop
logistic ?m ?n ?br ?bc ?b ?ar ?ac a
computes the logistic function 1/(1 + exp(-a)
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 relu : Lacaml_float64.Types.Mat.unop
relu ?m ?n ?br ?bc ?b ?ar ?ac a
computes the rectified linear unit function max(a, 0)
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 softplus : Lacaml_float64.Types.Mat.unop
softplus ?m ?n ?br ?bc ?b ?ar ?ac a
computes the softplus function log(1 + exp(x)
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 softsign : Lacaml_float64.Types.Mat.unop
softsign ?m ?n ?br ?bc ?b ?ar ?ac a
computes the softsign function x / (1 + abs(x))
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 pow : Lacaml_float64.Types.Mat.binop
pow ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes pow(a, b)
for 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 atan2 : Lacaml_float64.Types.Mat.binop
atan2 ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes atan2(a, b)
for 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.
NOTE: WARNING! From a geometric point of view, the atan2
function takes the y-coordinate in a
and the x-coordinate in b
. This confusion is a sad consequence of the C99-standard reversing the argument order for atan2
for no good reason.
val hypot : Lacaml_float64.Types.Mat.binop
hypot ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes sqrt(a*a + b*b)
for 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 min2 : Lacaml_float64.Types.Mat.binop
min2 ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes the elementwise minimum 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 max2 : Lacaml_float64.Types.Mat.binop
max2 ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes the elementwise maximum 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 cpab :
?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
Lacaml_float64.mat ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
unit
cpab ?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_float64.mat ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
unit
cmab ?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 log_sum_exp :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
Lacaml_float64.num_type
log_sum_exp ?m ?n ?ar ?ac a
computes the logarithm of the sum of exponentials of all elements in the m
-by-n
submatrix starting at row ar
and column ac
.
val create : int -> int -> Lacaml_float64.mat
create m n
val make : int -> int -> Lacaml_float64.num_type -> Lacaml_float64.mat
make m n x
val make0 : int -> int -> Lacaml_float64.mat
make0 m n x
val of_array : Lacaml_float64.num_type array array -> Lacaml_float64.mat
of_array ar
val to_array : Lacaml_float64.mat -> Lacaml_float64.num_type array array
to_array mat
val of_list : Lacaml_float64.num_type list list -> Lacaml_float64.mat
of_list ls
val to_list : Lacaml_float64.mat -> Lacaml_float64.num_type list list
to_array mat
val of_col_vecs : Lacaml_float64.vec array -> Lacaml_float64.mat
of_col_vecs ar
val to_col_vecs : Lacaml_float64.mat -> Lacaml_float64.vec array
to_col_vecs mat
val of_col_vecs_list : Lacaml_float64.vec list -> Lacaml_float64.mat
of_col_vecs_list ar
val to_col_vecs_list : Lacaml_float64.mat -> Lacaml_float64.vec list
to_col_vecs_list mat
val as_vec : Lacaml_float64.mat -> Lacaml_float64.vec
as_vec mat
val init_rows :
int ->
int ->
(int -> int -> Lacaml_float64.num_type) ->
Lacaml_float64.mat
init_cols m n f
val init_cols :
int ->
int ->
(int -> int -> Lacaml_float64.num_type) ->
Lacaml_float64.mat
init_cols m n f
val create_mvec : int -> Lacaml_float64.mat
create_mvec m
val make_mvec : int -> Lacaml_float64.num_type -> Lacaml_float64.mat
make_mvec m x
val mvec_of_array : Lacaml_float64.num_type array -> Lacaml_float64.mat
mvec_of_array ar
val mvec_to_array : Lacaml_float64.mat -> Lacaml_float64.num_type array
mvec_to_array mat
val from_col_vec : Lacaml_float64.vec -> Lacaml_float64.mat
from_col_vec v
val from_row_vec : Lacaml_float64.vec -> Lacaml_float64.mat
from_row_vec v
val empty : Lacaml_float64.mat
empty
, the empty matrix.
val identity : int -> Lacaml_float64.mat
identity n
val of_diag :
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float64.mat ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.mat
of_diag ?n ?br ?bc ?b ?ofsx ?incx x
val dim1 : Lacaml_float64.mat -> int
dim1 m
val dim2 : Lacaml_float64.mat -> int
dim2 m
val has_zero_dim : Lacaml_float64.mat -> bool
has_zero_dim mat
checks whether matrix mat
has a dimension of size zero
. In this case it cannot contain data.
val col : Lacaml_float64.mat -> int -> Lacaml_float64.vec
col m n
val copy_row :
?vec:Lacaml_float64.vec ->
Lacaml_float64.mat ->
int ->
Lacaml_float64.vec
copy_row ?vec mat int
val swap :
?uplo:[ `U | `L ] ->
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
unit
swap ?m ?n ?ar ?ac a ?br ?bc b
swaps the contents of (sub-matrices) a
and b
.
val transpose_copy : Lacaml_float64.Types.Mat.unop
transpose_copy ?m ?n ?br ?bc ?b ?ar ?ac a
val detri :
?up:bool ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
unit
detri ?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_float64.mat ->
Lacaml_float64.vec
packed ?up ?n ?ar ?ac a
val unpacked : ?up:bool -> ?n:int -> Lacaml_float64.vec -> Lacaml_float64.mat
unpacked ?up x
val fill :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
Lacaml_float64.num_type ->
unit
fill ?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_float64.mat ->
Lacaml_float64.num_type
sum ?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_float64.num_type -> Lacaml_float64.Types.Mat.unop
add_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 : Lacaml_float64.Types.Mat.unop
neg ?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 : Lacaml_float64.Types.Mat.unop
reci ?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_float64.vec ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
Lacaml_float64.vec
copy_diag ?n ?ofsy ?incy ?y ?ar ?ac a
val trace : Lacaml_float64.mat -> Lacaml_float64.num_type
trace m
val scal :
?m:int ->
?n:int ->
Lacaml_float64.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
unit
scal ?m ?n alpha ?ar ?ac a
BLAS scal
function for (sub-)matrices.
val scal_cols :
?m:int ->
?n:int ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?ofs:int ->
Lacaml_float64.vec ->
unit
scal_cols ?m ?n ?ar ?ac a ?ofs alphas
column-wise scal
function for matrices.
val scal_rows :
?m:int ->
?n:int ->
?ofs:int ->
Lacaml_float64.vec ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
unit
scal_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_float64.mat ->
Lacaml_float64.num_type
syrk_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_float64.num_type ->
?ofsy:int ->
?y:Lacaml_float64.vec ->
?trans:Lacaml_common.trans2 ->
?alpha:Lacaml_float64.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
Lacaml_float64.vec
syrk_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 : Lacaml_float64.Types.Mat.binop
add ?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 : Lacaml_float64.Types.Mat.binop
sub ?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 : Lacaml_float64.Types.Mat.binop
mul ?m ?n ?cr ?cc ?c ?ar ?ac a ?br ?bc b
computes the element-wise 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.
NOTE: please do not confuse this function with matrix multiplication! The LAPACK-function for matrix multiplication is called gemm
, e.g. Lacaml.D.gemm
.
val div : Lacaml_float64.Types.Mat.binop
div ?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_float64.num_type ->
?m:int ->
?n:int ->
?xr:int ->
?xc:int ->
Lacaml_float64.mat ->
?yr:int ->
?yc:int ->
Lacaml_float64.mat ->
unit
axpy ?alpha ?m ?n ?xr ?xc x ?yr ?yc y
BLAS axpy
function for matrices.
val gemm_diag :
?n:int ->
?k:int ->
?beta:Lacaml_float64.num_type ->
?ofsy:int ->
?y:Lacaml_float64.vec ->
?transa:Lacaml_float64.trans3 ->
?alpha:Lacaml_float64.num_type ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?transb:Lacaml_float64.trans3 ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
Lacaml_float64.vec
gemm_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_float64.trans3 ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?transb:Lacaml_float64.trans3 ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
Lacaml_float64.num_type
gemm_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). When transposing a
, this yields the so-called Frobenius product of a
and b
. n
is the number of rows (columns) to consider in a
and the number of columns (rows) in b
. k
is the inner dimension to use for the product.
val symm2_trace :
?n:int ->
?upa:bool ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
?upb:bool ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
Lacaml_float64.num_type
symm2_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_float64.mat ->
?br:int ->
?bc:int ->
Lacaml_float64.mat ->
Lacaml_float64.num_type
ssqr_diff ?m ?n ?ar ?ac a ?br ?bc b
val map :
(Lacaml_float64.num_type -> Lacaml_float64.num_type) ->
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml_float64.mat ->
?ar:int ->
?ac:int ->
Lacaml_float64.mat ->
Lacaml_float64.mat
map f ?m ?n ?br ?bc ?b ?ar ?ac a
val fold_cols :
('a -> Lacaml_float64.vec -> 'a) ->
?n:int ->
?ac:int ->
'a ->
Lacaml_float64.mat ->
'a
fold_cols f ?n ?ac acc a