Trait Submatrix

Source
pub trait Submatrix<O>: Matrix
where O: Matrix,
{ type Index; // Required method fn submatrix(&self, index: Self::Index) -> O; }

Required Associated Types§

Required Methods§

Source

fn submatrix(&self, index: Self::Index) -> O

Returns the submatrix of a given cell

Mᵢⱼ

§Arguments
  • index - Row and/or collumn to neglect
§Examples
let a = [
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0]
];
let s = [
    [5.0, 6.0],
    [8.0, 9.0]
];
assert_eq!(a.submatrix((0, 0)), s);

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.

Implementations on Foreign Types§

Source§

impl<F: Clone, const L: usize, const H: usize> Submatrix<[[F; L]; { _ }]> for [[F; L]; H]
where Self: Matrix, [[F; L]; { _ }]: Matrix,

Source§

impl<F: Clone, const L: usize, const H: usize> Submatrix<[[F; { _ }]; H]> for [[F; L]; H]
where Self: Matrix, [[F; { _ }]; H]: Matrix,

Source§

impl<F: Clone, const L: usize, const H: usize> Submatrix<[[F; { _ }]; { _ }]> for [[F; L]; H]
where Self: Matrix, [[F; { _ }]; { _ }]: Matrix,

Implementors§