pub trait V1MatrixLayout: Clone {
// Required methods
fn num_rows(&self) -> usize;
fn num_cols(&self) -> usize;
fn num_children(&self) -> usize;
fn num_children_secondary(&self) -> usize;
fn v1_idx(&self, i: usize, j: usize) -> usize;
fn child<T, V>(&self, data: V, first_idx: usize) -> impl NVec<D1, T>
where V: NVec<D1, T>;
fn child_mut<T, V>(&self, data: V, first_idx: usize) -> impl NVecMut<D1, T>
where V: NVecMut<D1, T>;
}
Expand description
Layout for matrices with an underlying flat vector of D1
.
Required Methods§
Sourcefn num_children(&self) -> usize
fn num_children(&self) -> usize
Number of primary children:
- number of rows if row-major,
- number of columns if col-major.
Sourcefn num_children_secondary(&self) -> usize
fn num_children_secondary(&self) -> usize
Number of children of the transpose of the matrix:
- number of rows if col-major,
- number of columns if row-major.
Sourcefn v1_idx(&self, i: usize, j: usize) -> usize
fn v1_idx(&self, i: usize, j: usize) -> usize
Transformation of the row and column indices (i
, j
) into a one dimensional
index for the underlying data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.