package slap
Module Slap_common
Slap.Common contains definitions independent of the precision.
Flags
Diagonal-element flags
val unit : diagA matrix is unit triagular.
val non_unit : diagA matrix is not unit triagular.
val char_of_diag : diag -> charReturn a character of a flag (for BLAS/LAPACK).
Uppper/lower (triangular matrix) flags
val upper : [> `U ] uploUsing the upper triangular (or trapezoidal) part of a matrix.
val lower : [> `L ] uploUsing the lower triangular (or trapezoidal) part of a matrix.
val upper_lower : [> `A ] uploUsing both of the upper and lower triangular parts (i.e., all elements) of a matrix.
val char_of_uplo : _ uplo -> charReturn a character of a flag (for BLAS/LAPACK).
Transpose flags
The type of transpose flags.
'indimand'outdimrespectively 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). 'tagis`N(normal, i.e. not transposing),`T(transpose), or`C(conjugate transpose).
type (+'indim, +'outdim, +'tag) trans2 = ('indim, 'outdim, 'tag) trans constraint 'tag = [< `N | `T ]Types of transpose flags for real vectors or matrices. Values of this type are
type (+'indim, +'outdim, +'tag) trans3 = ('indim, 'outdim, 'tag) transTypes of transpose flags for complex vectors or matrices. Values of this type are
val normal : ('m * 'n, 'm * 'n, [> `N ]) transNon-transposed matrix.
val trans : ('m * 'n, 'n * 'm, [> `T ]) transTranspose of a matrix.
val conjtr : ('m * 'n, 'n * 'm, [> `C ]) trans3Conjugate transpose of a matrix.
val get_transposed_dim :
('m * 'n, 'k * 'l, _) trans ->
'm Slap_size.t ->
'n Slap_size.t ->
'k Slap_size.t * 'l Slap_size.tget_transposed_dim trans m n returns
(m * n)iftransisSlap_common.normal;(n * m)iftransisSlap_common.transorSlap_common.conjtr.
val char_of_trans : ('indim, 'outdim, 'tag) trans -> charReturn a character of a flag (for BLAS/LAPACK).
Direction of matrix multiplication
('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
Ais multiplied from the left byB(i.e.,A*B),'kis equal to'm; therefore the type ofSlap_common.leftis('m, 'm, 'n) side. - Conversely, if
Ais right-multiplied byB(i.e.,B*A),'kis equal to'n. Thus, the flagSlap_common.rightis given the type('n, 'm, 'n) side.
val left : ('m, 'm, 'n) sideLeft multiplication
val right : ('n, 'm, 'n) sideRight multiplication
val check_side_dim :
'k Slap_size.t ->
'm Slap_size.t ->
'n Slap_size.t ->
('k, 'm, 'n) side ->
boolAuxiliary function (used internally)
val char_of_side : ('k, 'm, 'n) side -> charReturn a character of a flag (for BLAS/LAPACK).
Matrix norms
type +'a norm2 = 'a norm constraint 'a = [< `O | `I ]Values of this type are Slap_common.norm_1 and Slap_common.norm_inf.
type +'a norm4 = 'a normValues of this type are
val norm_1 : [> `O ] norm1-norm of a matrix (maximum column sum).
val norm_inf : [> `I ] normInfinity-norm of a matrix (maximum row sum).
val norm_amax : [> `M ] normLargest absolute value of a matrix. (not a matrix norm)
val norm_frob : [> `F ] normFrobenius norm of a matrix.
val char_of_norm : _ norm -> charReturn a character of a flag (for BLAS/LAPACK).
SVD computation flags
val svd_all : ('a, 'a, 'b, 'c, 'd) svd_jobval svd_top : ('b, 'a, 'b, 'c, 'd) svd_jobval svd_overwrite : ('c, 'a, 'b, 'c, 'd) svd_jobval svd_no : ('d, 'a, 'b, 'c, 'd) svd_jobval char_of_svd_job : (_, _, _, _, _) svd_job -> charReturn 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.tval create_int_vec : 'n Slap_size.t -> ('n, 'cnt) int_vectype (+'n, +'cnt_or_dsc) int32_vec =
('n, int32, Bigarray.int32_elt, 'cnt_or_dsc) Slap_vec.tval create_int32_vec : 'n Slap_size.t -> ('n, 'cnt) int32_vecUtilities
val lacaml_trans2 : (_, _, _) trans -> Lacaml.Common.trans2val lacaml_trans3 : (_, _, _) trans -> [ `N | `T | `C ]val lacaml_svd_job : (_, _, _, _, _) svd_job -> Lacaml.Common.svd_job