devela/num/geom/linear/matrix/definitions.rs
1// devela::num::geom::alg::matrix::definitions
2//
3//! Defines [`Matrix`].
4//
5
6/// A static `R×C` shaped matrix backed by an array.
7///
8/// - `T` is the type of elements in the matrix.
9/// - `R` and `C` represent the dimensions in terms of columns and rows.
10/// - `LEN` is the total number of elements, and the product of `C` and `R`.
11/// - `RMAJ` indicates if the storage is row-major (`true`) or column-major (`false`).
12/// - `MAX_LEN_DET` is the maximum matrix length for calculating the determinant for
13/// square matrices of dimension > 3.
14pub struct Matrix<
15 T,
16 const R: usize,
17 const C: usize,
18 const LEN: usize,
19 const RMAJ: bool = true,
20 const MAX_LEN_DET: usize = { 4 * 4 },
21> {
22 /// Internal storage of matrix elements in a fixed-size array.
23 ///
24 /// - Stored in row-major or column-major order depending on `RMAJ`.
25 /// - Indexed using `(row, col)` accessor methods.
26 pub data: [T; LEN],
27}