Frama-C API - Matrix
val pretty : Stdlib.Format.formatter -> ('n, 'm) matrix -> unit
The call id n
returns the identity matrix in 𝕂ⁿˣⁿ.
The call zero n m
returns the 0 matrix in 𝕂ⁿˣᵐ.
The call shift n
returns a square matrix in 𝕂ⁿˣⁿ such as the first row and the last column is all zero, and the remaining is the identity.
val get : 'n Finite.finite -> 'm Finite.finite -> ('n, 'm) matrix -> scalar
The call get i j m
returns the coefficient of the i-th row and the j-th column.
val set : 'n Finite.finite -> 'm Finite.finite -> scalar -> ('n, 'm) matrix -> ('n, 'm) matrix
The call set i j x m
returns a new matrix of the same linear space as m
, and with the same coefficients, except for the one of the i-th row and the j-th column, which is set to the scalar x
.
The call norm_inf m
computes the ∞-norm of m
, i.e the maximum of the absolute sums of the rows of m
.
The call norm_one m
computes the 1-norm of m
, i.e the maximum of the absolute sums of the columns of m
.
The call transpose m
for m in 𝕂ⁿˣᵐ returns a new matrix in 𝕂ᵐˣⁿ with all the coefficients transposed.
The call dimensions m
for m in 𝕂ⁿˣᵐ returns the pair (n, m).
Matrices addition. The dimensions compatibility is statically ensured.
Matrices substraction. As for the addition, the dimensions compatibility is statically ensured.
Matrices multiplication. The dimensions compatibility is statically ensured.
Matrix exponentiation. The call power m
returns a memoized function. When one needs to compute several exponentiations of the same matrix, one should perform the call power m
once and used the returned function each times one needs it.
Matrix inverse. Returns None if the input matrix is singular.