module Slap_common: sig
.. end
Slap.Common
contains definitions independent of the precision.
Flags
Flags
Diagonal-element flags
type
diag
The type of diagonal-element flags
val unit : diag
A matrix is unit triagular.
val non_unit : diag
A matrix is not unit triagular.
val char_of_diag : diag -> char
Return a character of a flag (for BLAS/LAPACK).
Uppper/lower (triangular matrix) flags
type +[< `A | `L | `U ]
uplo
The type of upper/lower flags.
val upper : [< `A | `L | `U > `U ] uplo
Using the upper triangular (or trapezoidal) part of a matrix.
val lower : [< `A | `L | `U > `L ] uplo
Using the lower triangular (or trapezoidal) part of a matrix.
val upper_lower : [< `A | `L | `U > `A ] uplo
Using both of the upper and lower triangular parts (i.e., all elements) of a
matrix.
val char_of_uplo : [< `A | `L | `U ] uplo -> char
Return a character of a flag (for BLAS/LAPACK).
Transpose flags
type (+'indim, +'outdim, +[< `C | `N | `T ])
trans
The type of transpose flags.
'indim
and 'outdim
respectively mean pairs of dimensions of an input
matrix and an output matrix:
- Not transposing:
'indim
= 'outdim
= 'm * 'n
, and
- Transposing:
'indim
= 'm * 'n
, 'outdim
= 'n * 'm
(swapped from 'indim
).
'tag
is `N
(normal, i.e. not transposing), `T
(transpose), or
`C
(conjugate transpose).
type ('indim, 'outdim, [< `N | `T ])
trans2 = ('indim, 'outdim, [< `N | `T ] as 'a) trans
Types of transpose flags for real vectors or matrices.
Values of this type are
type ('indim, 'outdim, [< `C | `N | `T ])
trans3 = ('indim, 'outdim, [< `C | `N | `T ] as 'a) trans
Types of transpose flags for complex vectors or matrices.
Values of this type are
val normal : ('m * 'n, 'm * 'n, [< `C | `N | `T > `N ]) trans
Non-transposed matrix.
val trans : ('m * 'n, 'n * 'm, [< `C | `N | `T > `T ]) trans
Transpose of a matrix.
val conjtr : ('m * 'n, 'n * 'm, [< `C | `N | `T > `C ]) trans3
Conjugate transpose of a matrix.
val get_transposed_dim : ('m * 'n, 'k * 'l, [< `C | `N | `T ]) trans ->
'm Slap_size.t -> 'n Slap_size.t -> 'k Slap_size.t * 'l Slap_size.t
get_transposed_dim trans m n
returns
val char_of_trans : ('indim, 'outdim, [< `C | `N | `T ]) trans -> char
Return a character of a flag (for BLAS/LAPACK).
Direction of matrix multiplication
type (+'k, +'m, +'n)
side
('k, 'm, 'n) side
is the type of left- and right-multiplication flags.
The type parameters
'k
,
'm
and
'n
correspond to dimensions of two
multiplied matrices: Let
A
be a
'k
-by-
'k
square matrix
and
B
be a
'm
-by-
'n
general matrix.
- When
A
is multiplied from the left by B
(i.e., A*B
), 'k
is equal
to 'm
; therefore the type of Slap_common.left
is ('m, 'm, 'n) side
.
- Conversely, if
A
is right-multiplied by B
(i.e., B*A
), 'k
is equal
to 'n
. Thus, the flag Slap_common.right
is given the type
('n, 'm, 'n) side
.
val left : ('m, 'm, 'n) side
Left multiplication
val right : ('n, 'm, 'n) side
Right multiplication
val check_side_dim : 'k Slap_size.t ->
'm Slap_size.t -> 'n Slap_size.t -> ('k, 'm, 'n) side -> bool
Auxiliary function (used internally)
val char_of_side : ('k, 'm, 'n) side -> char
Return a character of a flag (for BLAS/LAPACK).
Matrix norms
type +[< `F | `I | `M | `O ]
norm
The type of matrix norms.
type [< `I | `O ]
norm2 = ([< `I | `O ] as 'a) norm
type [< `F | `I | `M | `O ]
norm4 = ([< `F | `I | `M | `O ] as 'a) norm
val norm_1 : [< `F | `I | `M | `O > `O ] norm
1-norm of a matrix (maximum column sum).
val norm_inf : [< `F | `I | `M | `O > `I ] norm
Infinity-norm of a matrix (maximum row sum).
val norm_amax : [< `F | `I | `M | `O > `M ] norm
Largest absolute value of a matrix. (not a matrix norm)
val norm_frob : [< `F | `I | `M | `O > `F ] norm
Frobenius norm of a matrix.
val char_of_norm : [< `F | `I | `M | `O ] norm -> char
Return a character of a flag (for BLAS/LAPACK).
SVD computation flags
type (+'a, +'b, +'c, +'d, +'e)
svd_job
val svd_all : ('a, 'a, 'b, 'c, 'd) svd_job
val svd_top : ('b, 'a, 'b, 'c, 'd) svd_job
val svd_overwrite : ('c, 'a, 'b, 'c, 'd) svd_job
val svd_no : ('d, 'a, 'b, 'c, 'd) svd_job
val char_of_svd_job : ('a, 'b, 'c, 'd, 'e) svd_job -> char
Return a character of a flag (for BLAS/LAPACK).
Integer vectors
type ('n, 'cnt_or_dsc)
int_vec = ('n, int, Bigarray.int_elt, 'cnt_or_dsc) Slap_vec.t
val create_int_vec : 'n Slap_size.t -> ('n, 'cnt) int_vec
type ('n, 'cnt_or_dsc)
int32_vec = ('n, int32, Bigarray.int32_elt, 'cnt_or_dsc) Slap_vec.t
val create_int32_vec : 'n Slap_size.t -> ('n, 'cnt) int32_vec
Utilities
val lacaml_trans2 : ('a, 'b, [< `C | `N | `T ]) trans -> Lacaml.Common.trans2
val lacaml_trans3 : ('a, 'b, [< `C | `N | `T ]) trans -> [ `C | `N | `T ]
val lacaml_svd_job : ('a, 'b, 'c, 'd, 'e) svd_job -> Lacaml.Common.svd_job
Internal functions
val __unexpose_uplo : char -> [< `A | `L | `U ] uplo
val __unexpose_norm : char -> [< `F | `I | `M | `O ] norm
val __unexpose_side : char -> ('a, 'b, 'c) side
val __unexpose_svd_job : char -> ('a, 'b, 'c, 'd, 'e) svd_job