Struct nalgebra::DMat2
[−]
[src]
pub struct DMat2<N> { // some fields omitted }
Methods
impl<N: Zero + Clone + Copy> DMat2<N>
[src]
fn new_zeros(nrows: usize, ncols: usize) -> DMat2<N>
Builds a matrix filled with zeros.
Arguments
dim
- The dimension of the matrix. Adim
-dimensional matrix containsdim * dim
components.
fn is_zero(&self) -> bool
Tests if all components of the matrix are zeroes.
fn reset(&mut self)
impl<N: Zero + Copy + Rand> DMat2<N>
[src]
fn new_random(nrows: usize, ncols: usize) -> DMat2<N>
Builds a matrix filled with random values.
impl<N: One + Zero + Clone + Copy> DMat2<N>
[src]
impl<N> DMat2<N>
[src]
fn nrows(&self) -> usize
The number of row on the matrix.
fn ncols(&self) -> usize
The number of columns on the matrix.
fn as_vec(&self) -> &[N]
Gets a reference to this matrix data. The returned vector contains the matrix data in column-major order.
fn as_mut_vec(&mut self) -> &mut [N]
Gets a mutable reference to this matrix data. The returned vector contains the matrix data in column-major order.
impl<N: Zero + Clone + Copy> DMat2<N>
[src]
fn from_elem(nrows: usize, ncols: usize, elem: N) -> DMat2<N>
Builds a matrix filled with a given constant.
fn from_row_vec(nrows: usize, ncols: usize, vec: &[N]) -> DMat2<N>
Builds a matrix filled with the components provided by a vector.
The vector contains the matrix data in row-major order.
Note that from_col_vec
is a lot faster than from_row_vec
since a $dmat
stores its data
in column-major order.
The vector must have at least nrows * ncols
elements.
fn from_col_vec(nrows: usize, ncols: usize, vec: &[N]) -> DMat2<N>
Builds a matrix filled with the components provided by a vector.
The vector contains the matrix data in column-major order.
Note that from_col_vec
is a lot faster than from_row_vec
since a $dmat
stores its data
in column-major order.
The vector must have at least nrows * ncols
elements.
fn from_fn<F: FnMut(usize, usize) -> N>(nrows: usize, ncols: usize, f: F) -> DMat2<N>
Builds a matrix using an initialization function.
impl<N> DMat2<N>
[src]
unsafe fn new_uninitialized(nrows: usize, ncols: usize) -> DMat2<N>
Trait Implementations
impl<N: PartialEq> PartialEq for DMat2<N>
[src]
fn eq(&self, other: &DMat2<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<N: Clone> Clone for DMat2<N>
[src]
fn clone(&self) -> DMat2<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: One + Zero + Clone + Copy> Eye for DMat2<N>
[src]
fn new_identity(dim: usize) -> DMat2<N>
Builds an identity matrix.
Arguments
dim
- The dimension of the matrix. Adim
-dimensional matrix containsdim * dim
components.
impl<N: Copy> Indexable<(usize, usize), N> for DMat2<N>
[src]
unsafe fn unsafe_set(&mut self, rowcol: (usize, usize), val: N)
Just like set
without bounds checking.
unsafe fn unsafe_at(&self, rowcol: (usize, usize)) -> N
Just like at
without bounds checking.
fn swap(&mut self, rowcol1: (usize, usize), rowcol2: (usize, usize))
Swaps the i
-th element of self
with its j
-th element.
impl<N> Shape<(usize, usize)> for DMat2<N>
[src]
impl<N> Index<(usize, usize)> for DMat2<N>
[src]
type Output = N
The returned type after indexing
fn index(&self, (i, j): (usize, usize)) -> &N
The method for the indexing (Foo[Bar]
) operation
impl<N> IndexMut<(usize, usize)> for DMat2<N>
[src]
fn index_mut(&mut self, (i, j): (usize, usize)) -> &mut N
The method for the indexing (Foo[Bar]
) operation
impl<N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<DMat2<N>> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the *
operator
fn mul(self, right: DMat2<N>) -> DMat2<N>
The method for the *
operator
impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'a DMat2<N>> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the *
operator
fn mul(self, right: &'a DMat2<N>) -> DMat2<N>
The method for the *
operator
impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<DMat2<N>> for &'a DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the *
operator
fn mul(self, right: DMat2<N>) -> DMat2<N>
The method for the *
operator
impl<'a, 'b, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'b DMat2<N>> for &'a DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the *
operator
fn mul(self, right: &DMat2<N>) -> DMat2<N>
The method for the *
operator
impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N> + Zero> Mul<DVec2<N>> for DMat2<N>
[src]
type Output = DVec2<N>
The resulting type after applying the *
operator
fn mul(self, right: DVec2<N>) -> DVec2<N>
The method for the *
operator
impl<N: BaseNum + Clone> Inv for DMat2<N>
[src]
fn inv(&self) -> Option<DMat2<N>>
Returns the inverse of m
.
fn inv_mut(&mut self) -> bool
In-place version of inverse
.
impl<N: Clone + Copy> Transpose for DMat2<N>
[src]
fn transpose(&self) -> DMat2<N>
Computes the transpose of a matrix.
fn transpose_mut(&mut self)
In-place version of transposed
.
impl<N: BaseNum + Cast<f64> + Clone> Mean<DVec2<N>> for DMat2<N>
[src]
impl<N: BaseNum + Cast<f64> + Clone> Cov<DMat2<N>> for DMat2<N>
[src]
fn cov(&self) -> DMat2<N>
Computes the covariance of the obsevations stored by m
: Read more
fn cov_to(&self, out: &mut M)
Computes the covariance of the obsevations stored by m
: Read more
impl<N: Copy + Zero> Col<DVec2<N>> for DMat2<N>
[src]
fn ncols(&self) -> usize
The number of column of this matrix or vector.
fn set_col(&mut self, col_id: usize, col: DVec2<N>)
Writes the i
-th column of self
.
fn col(&self, col_id: usize) -> DVec2<N>
Reads the i
-th column of self
.
impl<N: Copy + Clone + Zero> ColSlice<DVec2<N>> for DMat2<N>
[src]
fn col_slice(&self, col_id: usize, row_start: usize, row_end: usize) -> DVec2<N>
Returns a view to a slice of a column of a matrix.
impl<N: Copy + Zero> Row<DVec2<N>> for DMat2<N>
[src]
fn nrows(&self) -> usize
The number of column of self
.
fn set_row(&mut self, row_id: usize, row: DVec2<N>)
Writes the i
-th row of self
.
fn row(&self, row_id: usize) -> DVec2<N>
Reads the i
-th row of self
.
impl<N: Copy> RowSlice<DVec2<N>> for DMat2<N>
[src]
fn row_slice(&self, row_id: usize, col_start: usize, col_end: usize) -> DVec2<N>
Returns a view to a slice of a row of a matrix.
impl<N: Copy + Clone + Zero> Diag<DVec2<N>> for DMat2<N>
[src]
fn from_diag(diag: &DVec2<N>) -> DMat2<N>
Creates a new matrix with the given diagonal.
fn diag(&self) -> DVec2<N>
The diagonal of this matrix.
impl<N: ApproxEq<N>> ApproxEq<N> for DMat2<N>
[src]
fn approx_epsilon(_: Option<DMat2<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<DMat2<N>>) -> u32
Default ULPs for approximation.
fn approx_eq_eps(&self, other: &DMat2<N>, epsilon: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &DMat2<N>, ulps: u32) -> bool
Tests approximate equality using units in the last place (ULPs)
fn approx_eq(&self, other: &Self) -> bool
Tests approximate equality.
impl<N: Debug + Copy> Debug for DMat2<N>
[src]
impl<N: Copy + Mul<N, Output=N>> Mul<N> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the *
operator
fn mul(self, right: N) -> DMat2<N>
The method for the *
operator
impl<N: Copy + Div<N, Output=N>> Div<N> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the /
operator
fn div(self, right: N) -> DMat2<N>
The method for the /
operator
impl<N: Copy + Add<N, Output=N>> Add<N> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the +
operator
fn add(self, right: N) -> DMat2<N>
The method for the +
operator
impl<N: Copy + Add<N, Output=N>> Add<DMat2<N>> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the +
operator
fn add(self, right: DMat2<N>) -> DMat2<N>
The method for the +
operator
impl<'a, N: Copy + Add<N, Output=N>> Add<DMat2<N>> for &'a DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the +
operator
fn add(self, right: DMat2<N>) -> DMat2<N>
The method for the +
operator
impl<'a, N: Copy + Add<N, Output=N>> Add<&'a DMat2<N>> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the +
operator
fn add(self, right: &'a DMat2<N>) -> DMat2<N>
The method for the +
operator
impl<N: Copy + Sub<N, Output=N>> Sub<N> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the -
operator
fn sub(self, right: N) -> DMat2<N>
The method for the -
operator
impl<N: Copy + Sub<N, Output=N>> Sub<DMat2<N>> for DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the -
operator
fn sub(self, right: DMat2<N>) -> DMat2<N>
The method for the -
operator
impl<'a, N: Copy + Sub<N, Output=N>> Sub<DMat2<N>> for &'a DMat2<N>
[src]
type Output = DMat2<N>
The resulting type after applying the -
operator
fn sub(self, right: DMat2<N>) -> DMat2<N>
The method for the -
operator