Struct nalgebra::DMat
[−]
[src]
pub struct DMat<N> { // some fields omitted }
Matrix with dimensions unknown at compile-time.
Methods
impl<N> DMat<N>
[src]
unsafe fn new_uninitialized(nrows: usize, ncols: usize) -> DMat<N>
Creates an uninitialized matrix.
impl<N: Clone + Copy> DMat<N>
[src]
fn from_elem(nrows: usize, ncols: usize, val: N) -> DMat<N>
Builds a matrix filled with a given constant.
fn from_row_vec(nrows: usize, ncols: usize, vec: &[N]) -> DMat<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 much faster than from_row_vec
since a DMat
stores its data
in column-major order.
The vector must have exactly nrows * ncols
elements.
fn from_col_vec(nrows: usize, ncols: usize, vec: &[N]) -> DMat<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 much faster than from_row_vec
since a DMat
stores its data
in column-major order.
The vector must have exactly nrows * ncols
elements.
fn from_row_iter<I: IntoIterator<Item=N>>(nrows: usize, ncols: usize, param: I) -> DMat<N>
Builds a matrix filled with the components provided by a source that may be moved into an iterator.
The source contains the matrix data in row-major order.
Note that from_col_iter
is much faster than from_row_iter
since a DMat
stores its data
in column-major order.
The source must have exactly nrows * ncols
elements.
fn from_col_iter<I: IntoIterator<Item=N>>(nrows: usize, ncols: usize, param: I) -> DMat<N>
Builds a matrix filled with the components provided by a source that may be moved into an iterator.
The source contains the matrix data in column-major order.
Note that from_col_iter
is much faster than from_row_iter
since a DMat
stores its data
in column-major order.
The source must have exactly nrows * ncols
elements.
impl<N> DMat<N>
[src]
fn from_fn<F: FnMut(usize, usize) -> N>(nrows: usize, ncols: usize, f: F) -> DMat<N>
Builds a matrix using an initialization function.
fn into_vec(self) -> Vec<N>
Transforms this matrix into an array. This consumes the matrix and is O(1). The returned vector contains the matrix data in column-major order.
impl<N: Zero + Clone + Copy> DMat<N>
[src]
fn new_zeros(nrows: usize, ncols: usize) -> DMat<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> DMat<N>
[src]
fn new_random(nrows: usize, ncols: usize) -> DMat<N>
Builds a matrix filled with random values.
impl<N: One + Zero + Clone + Copy> DMat<N>
[src]
impl<N> DMat<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.
Trait Implementations
impl<N: Clone> Clone for DMat<N>
[src]
fn clone(&self) -> DMat<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: PartialEq> PartialEq for DMat<N>
[src]
fn eq(&self, __arg_0: &DMat<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DMat<N>) -> bool
This method tests for !=
.
impl<N: Eq> Eq for DMat<N>
[src]
impl<N: One + Zero + Clone + Copy> Eye for DMat<N>
[src]
fn new_identity(dim: usize) -> DMat<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 DMat<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 DMat<N>
[src]
impl<N> Index<(usize, usize)> for DMat<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 DMat<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<DMat<N>> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the *
operator
fn mul(self, right: DMat<N>) -> DMat<N>
The method for the *
operator
impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'a DMat<N>> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the *
operator
fn mul(self, right: &'a DMat<N>) -> DMat<N>
The method for the *
operator
impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<DMat<N>> for &'a DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the *
operator
fn mul(self, right: DMat<N>) -> DMat<N>
The method for the *
operator
impl<'a, 'b, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'b DMat<N>> for &'a DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the *
operator
fn mul(self, right: &DMat<N>) -> DMat<N>
The method for the *
operator
impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N> + Zero> Mul<DVec<N>> for DMat<N>
[src]
type Output = DVec<N>
The resulting type after applying the *
operator
fn mul(self, right: DVec<N>) -> DVec<N>
The method for the *
operator
impl<N: BaseNum + Clone> Inv for DMat<N>
[src]
fn inv(&self) -> Option<DMat<N>>
Returns the inverse of m
.
fn inv_mut(&mut self) -> bool
In-place version of inverse
.
impl<N: Clone + Copy> Transpose for DMat<N>
[src]
fn transpose(&self) -> DMat<N>
Computes the transpose of a matrix.
fn transpose_mut(&mut self)
In-place version of transposed
.
impl<N: BaseNum + Cast<f64> + Clone> Mean<DVec<N>> for DMat<N>
[src]
impl<N: BaseNum + Cast<f64> + Clone> Cov<DMat<N>> for DMat<N>
[src]
fn cov(&self) -> DMat<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<DVec<N>> for DMat<N>
[src]
fn ncols(&self) -> usize
The number of column of this matrix or vector.
fn set_col(&mut self, col_id: usize, col: DVec<N>)
Writes the i
-th column of self
.
fn col(&self, col_id: usize) -> DVec<N>
Reads the i
-th column of self
.
impl<N: Copy + Clone + Zero> ColSlice<DVec<N>> for DMat<N>
[src]
fn col_slice(&self, col_id: usize, row_start: usize, row_end: usize) -> DVec<N>
Returns a view to a slice of a column of a matrix.
impl<N: Copy + Zero> Row<DVec<N>> for DMat<N>
[src]
fn nrows(&self) -> usize
The number of column of self
.
fn set_row(&mut self, row_id: usize, row: DVec<N>)
Writes the i
-th row of self
.
fn row(&self, row_id: usize) -> DVec<N>
Reads the i
-th row of self
.
impl<N: Copy> RowSlice<DVec<N>> for DMat<N>
[src]
fn row_slice(&self, row_id: usize, col_start: usize, col_end: usize) -> DVec<N>
Returns a view to a slice of a row of a matrix.
impl<N: Copy + Clone + Zero> Diag<DVec<N>> for DMat<N>
[src]
fn from_diag(diag: &DVec<N>) -> DMat<N>
Creates a new matrix with the given diagonal.
fn diag(&self) -> DVec<N>
The diagonal of this matrix.
impl<N: ApproxEq<N>> ApproxEq<N> for DMat<N>
[src]
fn approx_epsilon(_: Option<DMat<N>>) -> N
Default epsilon for approximation.
fn approx_ulps(_: Option<DMat<N>>) -> u32
Default ULPs for approximation.
fn approx_eq_eps(&self, other: &DMat<N>, epsilon: &N) -> bool
Tests approximate equality using a custom epsilon.
fn approx_eq_ulps(&self, other: &DMat<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 DMat<N>
[src]
impl<N: Copy + Mul<N, Output=N>> Mul<N> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the *
operator
fn mul(self, right: N) -> DMat<N>
The method for the *
operator
impl<N: Copy + Div<N, Output=N>> Div<N> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the /
operator
fn div(self, right: N) -> DMat<N>
The method for the /
operator
impl<N: Copy + Add<N, Output=N>> Add<N> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the +
operator
fn add(self, right: N) -> DMat<N>
The method for the +
operator
impl<N: Copy + Add<N, Output=N>> Add<DMat<N>> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the +
operator
fn add(self, right: DMat<N>) -> DMat<N>
The method for the +
operator
impl<'a, N: Copy + Add<N, Output=N>> Add<DMat<N>> for &'a DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the +
operator
fn add(self, right: DMat<N>) -> DMat<N>
The method for the +
operator
impl<'a, N: Copy + Add<N, Output=N>> Add<&'a DMat<N>> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the +
operator
fn add(self, right: &'a DMat<N>) -> DMat<N>
The method for the +
operator
impl<N: Copy + Sub<N, Output=N>> Sub<N> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the -
operator
fn sub(self, right: N) -> DMat<N>
The method for the -
operator
impl<N: Copy + Sub<N, Output=N>> Sub<DMat<N>> for DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the -
operator
fn sub(self, right: DMat<N>) -> DMat<N>
The method for the -
operator
impl<'a, N: Copy + Sub<N, Output=N>> Sub<DMat<N>> for &'a DMat<N>
[src]
type Output = DMat<N>
The resulting type after applying the -
operator
fn sub(self, right: DMat<N>) -> DMat<N>
The method for the -
operator