package slap

  1. Overview
  2. Docs

Slap.Common contains definitions independent of the precision.

Flags

type diag = [
  1. | `N
  2. | `U
]

Transpose flags

type (+'a, +'tag) trans
type transNT
type +'a trans2 = ('a, transNT) trans

Types of transpose flags for real vectors or matrices. Values of this type are

type transNTC
type +'a trans3 = ('a, transNTC) trans

Types of transpose flags for complex vectors or matrices. Values of this type are

val normal : (('m, 'n, 'num, 'prec, 'cd) Slap_mat.t -> ('m, 'n, 'num, 'prec, 'cd) Slap_mat.t, _) trans

Non-transposed matrix.

val trans : (('m, 'n, 'num, 'prec, 'cd) Slap_mat.t -> ('n, 'm, 'num, 'prec, 'cd) Slap_mat.t, _) trans

Transpose of a matrix.

val conjtr : (('m, 'n, 'num, 'prec, 'cd) Slap_mat.t -> ('n, 'm, 'num, 'prec, 'cd) Slap_mat.t) trans3

Conjugate transpose of a matrix.

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
val right : ('n, 'm, 'n) side

Slap_Mat.Trix norms

type (+'a, +'tag) norm
type norm2_tag
type +'a norm2 = ('a, norm2_tag) norm

Values of this type are Slap_common.norm_1 and Slap_common.norm_inf.

type norm4_tag
type norm_1
val norm_1 : (norm_1, _) norm

1-norm of a matrix (maximum column sum).

type norm_inf
val norm_inf : (norm_inf, _) norm

Infinity-norm of a matrix (maximum row sum).

type norm_amax
val norm_amax : (norm_amax, norm4_tag) norm

Largest absolute value of a matrix. (not a matrix norm)

type norm_frob
val norm_frob : (norm_frob, norm4_tag) norm

Frobenius norm of a matrix.

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

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 get_transposed_dim : (('m, 'n, 'num, 'prec, _) Slap_mat.t -> ('k, 'l, 'num, 'prec, _) Slap_mat.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 lacaml_trans2 : (_, _) trans -> Lacaml.Common.trans2
val lacaml_trans3 : (_, _) trans -> [ `N | `T | `C ]
val lacaml_side : (_, _, _) side -> Lacaml.Common.side
val lacaml_norm2 : (_, _) norm -> Lacaml.Common.norm2
val lacaml_norm4 : (_, _) norm -> Lacaml.Common.norm4
val lacaml_norm2_opt : (_, _) norm option -> Lacaml.Common.norm2 option
val lacaml_norm4_opt : (_, _) norm option -> Lacaml.Common.norm4 option
val lacaml_svd_job : (_, _, _, _, _) svd_job -> Lacaml.Common.svd_job
OCaml

Innovation. Community. Security.