module Mat:sig..end
typet =Lacaml__S.mat
typeunop =?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml__S.mat -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> Lacaml__S.mat
typebinop =?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
?c:Lacaml__S.mat ->
?ar:int ->
?ac:int ->
Lacaml__S.mat -> ?br:int -> ?bc:int -> Lacaml__S.mat -> Lacaml__S.mat
val hilbert : int -> Lacaml__S.mathilbert n
nxn Hilbert matrix.val hankel : int -> Lacaml__S.mathankel n
nxn Hankel matrix.val pascal : int -> Lacaml__S.matpascal n
nxn Pascal matrix.val rosser : unit -> Lacaml__S.matrosser n
val toeplitz : Lacaml__S.vec -> Lacaml__S.mattoeplitz v
Invalid_argument if the length of v is not an odd number.v.
The constant diagonals are read from left to right from v.val vandermonde : Lacaml__S.vec -> Lacaml__S.matvandermonde v
v.val wilkinson : int -> Lacaml__S.matwilkinson n
Invalid_argument if n is not an odd number >= 3.nxn Wilkinson matrix.val random : ?rnd_state:Stdlib.Random.State.t ->
?from:float -> ?range:float -> int -> int -> Lacaml__S.matrandom ?rnd_state ?from ?range m n
mxn matrix
initialized with random elements sampled uniformly from range
starting at from. A random state rnd_state can be passed.rnd_state : default = Random.get_state ()from : default = -1.0range : default = 2.0val abs : unopabs ?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 : unopsignum ?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 : 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 : 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 cbrt : unopcbrt ?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 : 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 exp2 : unopexp2 ?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 : unopexpm1 ?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 : 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 log10 : unoplog10 ?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 : unoplog2 ?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 : unoplog1p ?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 : 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 : 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 : 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 asin : unopasin ?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 : unopacos ?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 : unopatan ?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 : unopsinh ?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 : unopcosh ?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 : 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 asinh : unopasinh ?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 : unopacosh ?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 : unopatanh ?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 : unopfloor ?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 : unopceil ?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 : unopround ?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 : unoptrunc ?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 : unoperf ?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 : unoperfc ?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 : unoplogistic ?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 : unoprelu ?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 : unopsoftplus ?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 : unopsoftsign ?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 : binoppow ?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 : binopatan2 ?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 : binophypot ?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 : binopmin2 ?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 : binopmax2 ?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__S.mat ->
?ar:int ->
?ac:int -> Lacaml__S.mat -> ?br:int -> ?bc:int -> Lacaml__S.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.
m : default = number of rows of an : default = number of columns of acr : default = 1cc : default = 1ar : default = 1ac : default = 1br : default = 1bc : default = 1val cmab : ?m:int ->
?n:int ->
?cr:int ->
?cc:int ->
Lacaml__S.mat ->
?ar:int ->
?ac:int -> Lacaml__S.mat -> ?br:int -> ?bc:int -> Lacaml__S.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.
m : default = number of rows of an : default = number of columns of acr : default = 1cc : default = 1ar : default = 1ac : default = 1br : default = 1bc : default = 1val log_sum_exp : ?m:int -> ?n:int -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> floatlog_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__S.matcreate m n
m rows and n columns.val make : int -> int -> float -> Lacaml__S.matmake m n x
m rows and n columns
initialized with value x.val make0 : int -> int -> Lacaml__S.matmake0 m n x
m rows and n columns
initialized with the zero element.val of_array : float array array -> Lacaml__S.matof_array ar
ar. It is assumed that the OCaml matrix is in row major order
(standard).val to_array : Lacaml__S.mat -> float array arrayto_array mat
mat.val of_list : float list list -> Lacaml__S.matof_list ls
ls. Each sublist of ls represents a row of the desired matrix,
and must be of the same length.val to_list : Lacaml__S.mat -> float list listto_array mat
mat in row major order as lists.val of_col_vecs : Lacaml__S.vec array -> Lacaml__S.matof_col_vecs ar
ar. The vectors must be of same length.val to_col_vecs : Lacaml__S.mat -> Lacaml__S.vec arrayto_col_vecs mat
mat.val of_col_vecs_list : Lacaml__S.vec list -> Lacaml__S.matof_col_vecs_list ar
ar. The vectors must be of same length.val to_col_vecs_list : Lacaml__S.mat -> Lacaml__S.vec listto_col_vecs_list mat
mat.val as_vec : Lacaml__S.mat -> Lacaml__S.vecas_vec mat
val init_rows : int -> int -> (int -> int -> float) -> Lacaml__S.matinit_cols m n f
m rows and n
columns, where each element at row and col is initialized by the
result of calling f row col. The elements are passed row-wise.val init_cols : int -> int -> (int -> int -> float) -> Lacaml__S.matinit_cols m n f
m rows and n
columns, where each element at row and col is initialized by the
result of calling f row col. The elements are passed column-wise.val create_mvec : int -> Lacaml__S.matcreate_mvec m
m rows.val make_mvec : int -> float -> Lacaml__S.matmake_mvec m x
m rows
initialized with value x.val mvec_of_array : float array -> Lacaml__S.matmvec_of_array ar
ar.val mvec_to_array : Lacaml__S.mat -> float arraymvec_to_array mat
mat.val from_col_vec : Lacaml__S.vec -> Lacaml__S.matfrom_col_vec v
v.
The data is shared.val from_row_vec : Lacaml__S.vec -> Lacaml__S.matfrom_row_vec v
v.
The data is shared.val empty : Lacaml__S.matempty, the empty matrix.
val identity : int -> Lacaml__S.matidentity n
nxn identity matrix.val of_diag : ?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml__S.mat -> ?ofsx:int -> ?incx:int -> Lacaml__S.vec -> Lacaml__S.matof_diag ?n ?br ?bc ?b ?ofsx ?incx x
b with diagonal
elements in the designated sub-matrix coming from the designated sub-vector
in x.n : default = greater n s.t. ofsx+(n-1)(abs incx) <= dim xbr : default = 1bc : default = 1b : default = minimal fresh matrix consistent with n, br, and bcofsx : default = 1incx : default = 1val dim1 : Lacaml__S.mat -> intdim1 m
m (number of rows).val dim2 : Lacaml__S.mat -> intdim2 m
m (number of columns).val has_zero_dim : Lacaml__S.mat -> boolhas_zero_dim mat checks whether matrix mat has a dimension of size
zero. In this case it cannot contain data.
val col : Lacaml__S.mat -> int -> Lacaml__S.veccol m n
nth column of matrix m as a vector.
The data is shared.val copy_row : ?vec:Lacaml__S.vec -> Lacaml__S.mat -> int -> Lacaml__S.veccopy_row ?vec mat int
nth row of matrix m
in vector vec.vec : default = fresh vector of length dim2 matval swap : ?uplo:[ `L | `U ] ->
?m:int ->
?n:int ->
?ar:int ->
?ac:int -> Lacaml__S.mat -> ?br:int -> ?bc:int -> Lacaml__S.mat -> unitswap ?m ?n ?ar ?ac a ?br ?bc b swaps the contents of (sub-matrices)
a and b.
m : default = greater n s.t. ar + m - 1 <= dim1 an : default = greater n s.t. ac + n - 1 <= dim2 aar : default = 1ac : default = 1br : default = 1bc : default = 1val transpose_copy : unoptranspose_copy ?m ?n ?br ?bc ?b ?ar ?ac a
a. If b is given, the result will be stored in there
using offsets br and bc, otherwise a fresh matrix will be used.
NOTE: this operations does _not_ support in-place transposes!val detri : ?up:bool -> ?n:int -> ?ar:int -> ?ac:int -> Lacaml__S.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.
up : default = truen : default = Mat.dim1 aar : default = 1ac : default = 1val packed : ?up:bool -> ?n:int -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> Lacaml__S.vecpacked ?up ?n ?ar ?ac a
a in packed
storage format.up : default = truen : default = Mat.dim2 aar : default = 1ac : default = 1val unpacked : ?up:bool -> ?n:int -> Lacaml__S.vec -> Lacaml__S.matunpacked ?up x
up)
triangular matrix from packed representation vec. The other
triangle of the matrix will be filled with zeros.up : default = truen : default = Vec.dim xval fill : ?m:int -> ?n:int -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> float -> 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__S.mat -> floatsum ?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 : float -> unopadd_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 : unopneg ?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 : unopreci ?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__S.vec -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> Lacaml__S.veccopy_diag ?n ?ofsy ?incy ?y ?ar ?ac a
a in a (sub-)vector.n : default = greatest n that does not exceed matrix dimensionsofsy : default = 1incy : default = 1y : default = fresh vector of length nar : default = 1ac : default = 1val trace : Lacaml__S.mat -> floattrace m
m. If m is not a
square matrix, the sum of the longest possible sequence of
diagonal elements will be returned.val scal : ?m:int -> ?n:int -> float -> ?ar:int -> ?ac:int -> Lacaml__S.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__S.mat -> ?ofs:int -> Lacaml__S.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__S.vec -> ?ar:int -> ?ac:int -> Lacaml__S.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__S.mat -> floatsyrk_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.
n : default = number of rows of ak : default = number of columns of aar : default = 1ac : default = 1val syrk_diag : ?n:int ->
?k:int ->
?beta:float ->
?ofsy:int ->
?y:Lacaml__S.vec ->
?trans:Lacaml__common.trans2 ->
?alpha:float -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> Lacaml__S.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.
n : default = number of rows of a (or tra)k : default = number of columns of a (or tra)beta : default = 0ofsy : default = 1y : default = fresh vector of size n + ofsy - 1trans : default = `Nalpha : default = 1ar : default = 1ac : default = 1val add : binopadd ?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 : binopsub ?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 : binopmul ?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 : binopdiv ?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:float ->
?m:int ->
?n:int ->
?xr:int ->
?xc:int -> Lacaml__S.mat -> ?yr:int -> ?yc:int -> Lacaml__S.mat -> unitaxpy ?alpha ?m ?n ?xr ?xc x ?yr ?yc y BLAS axpy function for
matrices.
val gemm_diag : ?n:int ->
?k:int ->
?beta:float ->
?ofsy:int ->
?y:Lacaml__S.vec ->
?transa:Lacaml__S.trans3 ->
?alpha:float ->
?ar:int ->
?ac:int ->
Lacaml__S.mat ->
?transb:Lacaml__S.trans3 ->
?br:int -> ?bc:int -> Lacaml__S.mat -> Lacaml__S.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.
n : default = number of rows of a (or tr a) and
number of columns of b (or tr b)k : default = number of columns of a (or tr a) and
number of rows of b (or tr b)beta : default = 0ofsy : default = 1y : default = fresh vector of size n + ofsy - 1transa : default = `Nalpha : default = 1ar : default = 1ac : default = 1transb : default = `Nbr : default = 1bc : default = 1val gemm_trace : ?n:int ->
?k:int ->
?transa:Lacaml__S.trans3 ->
?ar:int ->
?ac:int ->
Lacaml__S.mat ->
?transb:Lacaml__S.trans3 -> ?br:int -> ?bc:int -> Lacaml__S.mat -> floatgemm_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.
n : default = number of rows of a (or tr a) and
number of columns of b (or tr b)k : default = number of columns of a (or tr a) and
number of rows of b (or tr b)transa : default = `Nar : default = 1ac : default = 1transb : default = `Nbr : default = 1bc : default = 1val symm2_trace : ?n:int ->
?upa:bool ->
?ar:int ->
?ac:int ->
Lacaml__S.mat -> ?upb:bool -> ?br:int -> ?bc:int -> Lacaml__S.mat -> floatsymm2_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.
n : default = dimensions of a and bupa : default = true (upper triangular portion of a is accessed)ar : default = 1ac : default = 1upb : default = true (upper triangular portion of b is accessed)br : default = 1bc : default = 1val ssqr_diff : ?m:int ->
?n:int ->
?ar:int ->
?ac:int -> Lacaml__S.mat -> ?br:int -> ?bc:int -> Lacaml__S.mat -> floatssqr_diff ?m ?n ?ar ?ac a ?br ?bc b
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.m : default = greater n s.t. ar + m - 1 <= dim1 an : default = greater n s.t. ac + n - 1 <= dim2 aar : default = 1ac : default = 1br : default = 1bc : default = 1val map : (float -> float) ->
?m:int ->
?n:int ->
?br:int ->
?bc:int ->
?b:Lacaml__S.mat -> ?ar:int -> ?ac:int -> Lacaml__S.mat -> Lacaml__S.matmap f ?m ?n ?br ?bc ?b ?ar ?ac a
f applied to each element of a.m : default = number of rows of an : default = number of columns of ab : default = fresh matrix of size m by nval fold_cols : ('a -> Lacaml__S.vec -> 'a) -> ?n:int -> ?ac:int -> 'a -> Lacaml__S.mat -> 'afold_cols f ?n ?ac acc a
n : default = number of columns of aac : default = 1