Array representation of matrices #
This file relates Fin-indexed matrices to arrays of their entries in row-major ordering. This
means that, for an m by n matrix, the entry at row i and column j can be found at
index n * i + j in the array.
Main definitions #
Matrix.ofArray A h: The matrix withmrows andncolumns whose entries are obtained from the arrayAof sizem * nin row-major ordering.Matrix.toArray A: The array of entries of a matrix stored in row-major ordering.
Implementation notes #
The index in the array is computed using Fin.mkDivMod so that Fin.divNat and Fin.modNat can be
used to recover the matrix row and column from the array index.