pub trait Matrixwhere
Self: Index<usize, Output = Self::Column> + IndexMut<usize, Output = Self::Column> + ApproxEq<Epsilon = Self::Element>,{
type Element: BaseFloat;
type Row: Array<Element = Self::Element>;
type Column: Array<Element = Self::Element>;
type Transpose: Matrix<Element = Self::Element, Row = Self::Column, Column = Self::Row>;
Show 15 methods
// Required methods
fn row(&self, r: usize) -> Self::Row;
fn swap_rows(&mut self, a: usize, b: usize);
fn swap_columns(&mut self, a: usize, b: usize);
fn swap_elements(&mut self, a: (usize, usize), b: (usize, usize));
fn zero() -> Self;
fn mul_m(&self, other: &Self::Transpose) -> Self;
fn mul_v(&self, column: Self::Column) -> Self::Column;
fn mul_s(&self, scalar: Self::Element) -> Self;
fn div_s(&self, scalar: Self::Element) -> Self;
fn mul_self_s(&mut self, scalar: Self::Element);
fn div_self_s(&mut self, scalar: Self::Element);
fn transpose(&self) -> Self::Transpose;
// Provided methods
fn as_ptr(&self) -> *const Self::Element { ... }
fn as_mut_ptr(&mut self) -> *mut Self::Element { ... }
fn replace_col(&mut self, c: usize, src: Self::Column) -> Self::Column { ... }
}
Expand description
A column-major matrix of arbitrary dimensions.
Required Associated Types§
Required Methods§
sourcefn swap_columns(&mut self, a: usize, b: usize)
fn swap_columns(&mut self, a: usize, b: usize)
Swap two columns of this array.
sourcefn swap_elements(&mut self, a: (usize, usize), b: (usize, usize))
fn swap_elements(&mut self, a: (usize, usize), b: (usize, usize))
Swap the values at index a
and b
sourcefn mul_s(&self, scalar: Self::Element) -> Self
fn mul_s(&self, scalar: Self::Element) -> Self
Multiply this matrix by a scalar, returning the new matrix.
sourcefn div_s(&self, scalar: Self::Element) -> Self
fn div_s(&self, scalar: Self::Element) -> Self
Divide this matrix by a scalar, returning the new matrix.
sourcefn mul_self_s(&mut self, scalar: Self::Element)
fn mul_self_s(&mut self, scalar: Self::Element)
Multiply this matrix by a scalar, in-place.
sourcefn div_self_s(&mut self, scalar: Self::Element)
fn div_self_s(&mut self, scalar: Self::Element)
Divide this matrix by a scalar, in-place.
Provided Methods§
sourcefn as_mut_ptr(&mut self) -> *mut Self::Element
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
sourcefn replace_col(&mut self, c: usize, src: Self::Column) -> Self::Column
fn replace_col(&mut self, c: usize, src: Self::Column) -> Self::Column
Replace a column in the array.