Page
Library
Module
Module type
Parameter
Class
Class type
Source
Gg.MImplemented by all (square) matrix types.
val el : int -> int -> t -> floatel i j a is the element aij.
Raises Invalid_argument if i or j is not in [0;dim[.
col j a is the jth column of a.
Raises Invalid_argument if j is not in [0;dim[.
mul a b is the matrix multiplication a * b.
val trace : t -> floattrace a is the matrix trace trace(a).
val det : t -> floatdet a is the determinant |a|.
inv a is the inverse matrix a-1.
mapi f a is like map but the element indices are also given.
val fold : ('a -> float -> 'a) -> 'a -> t -> 'afold f acc a is f (...(f (f acc a00) a10)...).
val foldi : ('a -> int -> int -> float -> 'a) -> 'a -> t -> 'afoldi f acc a is f (...(f (f acc 0 0 a00) 1 0 a10)...).
val iter : (float -> unit) -> t -> unititer f a is f a00; f a10; ...
val iteri : (int -> int -> float -> unit) -> t -> unititeri f a is f 0 0 a00; f 1 0 a10; ...
val for_all : (float -> bool) -> t -> boolfor_all p a is p a00 && p a10 && ...
val exists : (float -> bool) -> t -> boolexists p a is p a00 || p a10 || ...
equal_f eq a b tests a and b like equal but uses eq to test floating point values.
compare a b is Stdlib.compare a b. That is lexicographic comparison in column-major order.
compare_f cmp a b compares a and b like compare but uses cmp to compare floating point values.
val pp : Format.formatter -> t -> unitpp ppf a prints a textual representation of a on ppf.
val pp_f : (Format.formatter -> float -> unit) -> Format.formatter -> t -> unitpp_f pp_e ppf a prints a like pp but uses pp_e to print floating point values.