pub struct RectMatrix<T: MatElement, const R: usize, const C: usize> { /* private fields */ }Implementations§
Source§impl<T: MatElement, const R: usize, const C: usize> RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> RectMatrix<T, R, C>
Sourcepub fn mat_from_vec(data: [[T; C]; R]) -> RectMatrix<T, R, C>
pub fn mat_from_vec(data: [[T; C]; R]) -> RectMatrix<T, R, C>
Create a new vector from data.
Sourcepub fn row_to_vec(&self, i: usize) -> [T; C]
pub fn row_to_vec(&self, i: usize) -> [T; C]
Returns the i-th row to an array.
Sourcepub fn col_to_vec(&self, j: usize) -> [T; R]
pub fn col_to_vec(&self, j: usize) -> [T; R]
Returns the j-th column as an array.
Sourcepub fn rect<const R2: usize, const C2: usize>(
&self,
top: usize,
left: usize,
) -> RectMatrix<T, R2, C2>
pub fn rect<const R2: usize, const C2: usize>( &self, top: usize, left: usize, ) -> RectMatrix<T, R2, C2>
Crops the matrix.
Sourcepub fn transposed(&self) -> RectMatrix<T, C, R>
pub fn transposed(&self) -> RectMatrix<T, C, R>
Transpose this matrix and returns a new transposed instance.
Sourcepub fn assign_col(
&mut self,
col: usize,
v: ColVector<T, R>,
) -> &RectMatrix<T, R, C>
pub fn assign_col( &mut self, col: usize, v: ColVector<T, R>, ) -> &RectMatrix<T, R, C>
Assigns a column.
Sourcepub fn is_lower_triangular(&self) -> bool
pub fn is_lower_triangular(&self) -> bool
Returns true iif the matrix is lower triangular.
Sourcepub fn is_upper_triangular(&self) -> bool
pub fn is_upper_triangular(&self) -> bool
Returns true iif the matrix is upper triangular.
Source§impl<const R: usize, const C: usize> RectMatrix<f64, R, C>
impl<const R: usize, const C: usize> RectMatrix<f64, R, C>
Sourcepub fn round(&mut self, decimals: i32) -> &RectMatrix<f64, R, C>
pub fn round(&mut self, decimals: i32) -> &RectMatrix<f64, R, C>
Rounds all the values in the matrix.
Source§impl<T: MatElement, const L: usize> RectMatrix<T, 1, L>
impl<T: MatElement, const L: usize> RectMatrix<T, 1, L>
Sourcepub fn row_from_vec(data: &[T]) -> RowVector<T, L>
pub fn row_from_vec(data: &[T]) -> RowVector<T, L>
Builds a RowVector from a vector.
Source§impl<T: MatElement, const L: usize> RectMatrix<T, L, 1>
impl<T: MatElement, const L: usize> RectMatrix<T, L, 1>
Sourcepub fn col_from_vec(data: &[T]) -> ColVector<T, L>
pub fn col_from_vec(data: &[T]) -> ColVector<T, L>
Builds a ColVector from a vector.
Trait Implementations§
Source§impl<T: MatElement, const R: usize, const C: usize> Add for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> Add for RectMatrix<T, R, C>
Source§impl<T: MatElement, const R: usize, const C: usize> AddAssign for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> AddAssign for RectMatrix<T, R, C>
Source§fn add_assign(&mut self, rhs: RectMatrix<T, R, C>)
fn add_assign(&mut self, rhs: RectMatrix<T, R, C>)
Performs the
+= operation. Read moreSource§impl<M: Copy + Default, F: MatElement + ApproxEq<Margin = M>, const R: usize, const C: usize> ApproxEq for RectMatrix<F, R, C>
impl<M: Copy + Default, F: MatElement + ApproxEq<Margin = M>, const R: usize, const C: usize> ApproxEq for RectMatrix<F, R, C>
Source§type Margin = M
type Margin = M
This type type defines a margin within which two values are to be
considered approximately equal. It must implement
Default so that
approx_eq() can be called on unknown types.Source§impl<T: MatElement, const R: usize, const C: usize> Clone for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> Clone for RectMatrix<T, R, C>
Source§fn clone(&self) -> RectMatrix<T, R, C>
fn clone(&self) -> RectMatrix<T, R, C>
Clones this matrix.
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + MatElement, const R: usize, const C: usize> Debug for RectMatrix<T, R, C>
impl<T: Debug + MatElement, const R: usize, const C: usize> Debug for RectMatrix<T, R, C>
Source§impl<T: MatElement, const R1: usize, const C1: usize, const C2: usize> Mul<RectMatrix<T, C1, C2>> for RectMatrix<T, R1, C1>
impl<T: MatElement, const R1: usize, const C1: usize, const C2: usize> Mul<RectMatrix<T, C1, C2>> for RectMatrix<T, R1, C1>
Source§fn mul(self, other: RectMatrix<T, C1, C2>) -> RectMatrix<T, R1, C2>
fn mul(self, other: RectMatrix<T, C1, C2>) -> RectMatrix<T, R1, C2>
Multiplication by another matrix.
Source§type Output = RectMatrix<T, R1, C2>
type Output = RectMatrix<T, R1, C2>
The resulting type after applying the
* operator.Source§impl<T: MatElement, const R: usize, const C: usize> Mul<T> for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> Mul<T> for RectMatrix<T, R, C>
Source§impl<T: MatElement, const R: usize, const C: usize> MulAssign<T> for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> MulAssign<T> for RectMatrix<T, R, C>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T: MatElement, const R: usize, const C: usize> PartialEq for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> PartialEq for RectMatrix<T, R, C>
Source§impl<T: MatElement, const R: usize, const C: usize> Sub for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> Sub for RectMatrix<T, R, C>
Source§impl<T: MatElement, const R: usize, const C: usize> SubAssign for RectMatrix<T, R, C>
impl<T: MatElement, const R: usize, const C: usize> SubAssign for RectMatrix<T, R, C>
Source§fn sub_assign(&mut self, rhs: RectMatrix<T, R, C>)
fn sub_assign(&mut self, rhs: RectMatrix<T, R, C>)
Performs the
-= operation. Read moreimpl<T: Copy + MatElement, const R: usize, const C: usize> Copy for RectMatrix<T, R, C>
impl<T: Eq + MatElement, const R: usize, const C: usize> Eq for RectMatrix<T, R, C>
Auto Trait Implementations§
impl<T, const R: usize, const C: usize> Freeze for RectMatrix<T, R, C>where
T: Freeze,
impl<T, const R: usize, const C: usize> RefUnwindSafe for RectMatrix<T, R, C>where
T: RefUnwindSafe,
impl<T, const R: usize, const C: usize> Send for RectMatrix<T, R, C>where
T: Send,
impl<T, const R: usize, const C: usize> Sync for RectMatrix<T, R, C>where
T: Sync,
impl<T, const R: usize, const C: usize> Unpin for RectMatrix<T, R, C>where
T: Unpin,
impl<T, const R: usize, const C: usize> UnwindSafe for RectMatrix<T, R, C>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more