Struct nalgebra::DMat [] [src]

pub struct DMat<N> {
    // some fields omitted
}

Matrix with dimensions unknown at compile-time.

Methods

impl<N> DMat<N>

unsafe fn new_uninitialized(nrows: usize, ncols: usize) -> DMat<N>

Creates an uninitialized matrix.

impl<N: Zero + Clone + Copy> DMat<N>

fn new_zeros(nrows: usize, ncols: usize) -> DMat<N>

Builds a matrix filled with zeros.

Arguments

  • dim - The dimension of the matrix. A dim-dimensional matrix contains dim * dim components.

fn is_zero(&self) -> bool

Tests if all components of the matrix are zeroes.

fn reset(&mut self)

impl<N: Rand> DMat<N>

fn new_random(nrows: usize, ncols: usize) -> DMat<N>

Builds a matrix filled with random values.

impl<N: One + Clone + Copy> DMat<N>

fn new_ones(nrows: usize, ncols: usize) -> DMat<N>

Builds a matrix filled with a given constant.

impl<N: Clone + Copy> DMat<N>

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 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]) -> 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 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.

impl<N> DMat<N>

fn from_fn<F: FnMut(usize, usize) -> N>(nrows: usize, ncols: usize, f: F) -> DMat<N>

Builds a matrix filled with a given constant.

fn nrows(&self) -> usize

The number of row on the matrix.

fn ncols(&self) -> usize

The number of columns on the matrix.

fn to_vec(self) -> Vec<N>

Transforms this matrix isizeo an array. This consumes the matrix and is O(1). The returned vector contains the matrix data in column-major order.

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: One + Zero + Clone + Copy> Eye for DMat<N>

fn new_identity(dim: usize) -> DMat<N>

impl<N: Copy> Indexable<(usize, usize), N> for DMat<N>

unsafe fn unsafe_set(&mut self, rowcol: (usize, usize), val: N)

unsafe fn unsafe_at(&self, rowcol: (usize, usize)) -> N

fn swap(&mut self, rowcol1: (usize, usize), rowcol2: (usize, usize))

impl<N> Shape<(usize, usize)> for DMat<N>

fn shape(&self) -> (usize, usize)

impl<N> Index<(usize, usize)> for DMat<N>

type Output = N

fn index(&self, (i, j): (usize, usize)) -> &N

impl<N> IndexMut<(usize, usize)> for DMat<N>

fn index_mut(&mut self, (i, j): (usize, usize)) -> &mut N

impl<N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<DMat<N>> for DMat<N>

type Output = DMat<N>

fn mul(self, right: DMat<N>) -> DMat<N>

impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'a DMat<N>> for DMat<N>

type Output = DMat<N>

fn mul(self, right: &'a DMat<N>) -> DMat<N>

impl<'a, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<DMat<N>> for &'a DMat<N>

type Output = DMat<N>

fn mul(self, right: DMat<N>) -> DMat<N>

impl<'a, 'b, N: Copy + Mul<N, Output=N> + Add<N, Output=N> + Zero> Mul<&'b DMat<N>> for &'a DMat<N>

type Output = DMat<N>

fn mul(self, right: &DMat<N>) -> DMat<N>

impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N> + Zero> Mul<DVec<N>> for DMat<N>

type Output = DVec<N>

fn mul(self, right: DVec<N>) -> DVec<N>

impl<N: BaseNum + Clone> Inv for DMat<N>

fn inv(&self) -> Option<DMat<N>>

fn inv_mut(&mut self) -> bool

impl<N: Clone + Copy> Transpose for DMat<N>

fn transpose(&self) -> DMat<N>

fn transpose_mut(&mut self)

impl<N: BaseNum + Cast<f64> + Clone> Mean<DVec<N>> for DMat<N>

fn mean(&self) -> DVec<N>

impl<N: BaseNum + Cast<f64> + Clone> Cov<DMat<N>> for DMat<N>

fn cov(&self) -> DMat<N>

fn cov_to(&self, out: &mut M)

impl<N: Copy + Clone> ColSlice<DVec<N>> for DMat<N>

fn col_slice(&self, col_id: usize, row_start: usize, row_end: usize) -> DVec<N>

impl<N: Copy> RowSlice<DVec<N>> for DMat<N>

fn row_slice(&self, row_id: usize, col_start: usize, col_end: usize) -> DVec<N>

impl<N: Copy + Clone + Zero> Diag<DVec<N>> for DMat<N>

fn from_diag(diag: &DVec<N>) -> DMat<N>

fn diag(&self) -> DVec<N>

impl<N: Copy + Clone + Zero> DiagMut<DVec<N>> for DMat<N>

fn set_diag(&mut self, diag: &DVec<N>)

impl<N: ApproxEq<N>> ApproxEq<N> for DMat<N>

fn approx_epsilon(_: Option<DMat<N>>) -> N

fn approx_ulps(_: Option<DMat<N>>) -> u32

fn approx_eq_eps(&self, other: &DMat<N>, epsilon: &N) -> bool

fn approx_eq_ulps(&self, other: &DMat<N>, ulps: u32) -> bool

fn approx_eq(&self, other: &Self) -> bool

impl<N: Debug + Copy> Debug for DMat<N>

fn fmt(&self, form: &mut Formatter) -> Result

impl<N: Copy + Mul<N, Output=N>> Mul<N> for DMat<N>

type Output = DMat<N>

fn mul(self, right: N) -> DMat<N>

impl<N: Copy + Div<N, Output=N>> Div<N> for DMat<N>

type Output = DMat<N>

fn div(self, right: N) -> DMat<N>

impl<N: Copy + Add<N, Output=N>> Add<N> for DMat<N>

type Output = DMat<N>

fn add(self, right: N) -> DMat<N>

impl<N: Copy + Add<N, Output=N>> Add<DMat<N>> for DMat<N>

type Output = DMat<N>

fn add(self, right: DMat<N>) -> DMat<N>

impl<'a, N: Copy + Add<N, Output=N>> Add<DMat<N>> for &'a DMat<N>

type Output = DMat<N>

fn add(self, right: DMat<N>) -> DMat<N>

impl<'a, N: Copy + Add<N, Output=N>> Add<&'a DMat<N>> for DMat<N>

type Output = DMat<N>

fn add(self, right: &'a DMat<N>) -> DMat<N>

impl<N: Copy + Sub<N, Output=N>> Sub<N> for DMat<N>

type Output = DMat<N>

fn sub(self, right: N) -> DMat<N>

impl<N: Copy + Sub<N, Output=N>> Sub<DMat<N>> for DMat<N>

type Output = DMat<N>

fn sub(self, right: DMat<N>) -> DMat<N>

impl<'a, N: Copy + Sub<N, Output=N>> Sub<DMat<N>> for &'a DMat<N>

type Output = DMat<N>

fn sub(self, right: DMat<N>) -> DMat<N>

impl<'a, N: Copy + Sub<N, Output=N>> Sub<&'a DMat<N>> for DMat<N>

type Output = DMat<N>

fn sub(self, right: &'a DMat<N>) -> DMat<N>

Derived Implementations

impl<N: Clone> Clone for DMat<N>

fn clone(&self) -> DMat<N>

fn clone_from(&mut self, source: &Self)

impl<N: PartialEq> PartialEq for DMat<N>

fn eq(&self, __arg_0: &DMat<N>) -> bool

fn ne(&self, __arg_0: &DMat<N>) -> bool

impl<N: Eq> Eq for DMat<N>