Struct nalgebra::DVec
[−]
[src]
pub struct DVec<N> { pub at: Vec<N>, }
Heap allocated, dynamically sized vector.
Fields
at | Components of the vector. Contains as much elements as the vector dimension. |
Methods
impl<N> DVec<N>
unsafe fn new_uninitialized(dim: usize) -> DVec<N>
Creates an uninitialized vec.
impl<N: Clone> DVec<N>
fn from_elem(dim: usize, elem: N) -> DVec<N>
Builds a vector filled with a constant.
fn from_slice(dim: usize, vec: &[N]) -> DVec<N>
Builds a vector filled with the components provided by a vector.
The vector must have at least dim
elements.
impl<N> DVec<N>
fn from_fn<F: FnMut(usize) -> N>(dim: usize, f: F) -> DVec<N>
Builds a vector filled with the result of a function.
fn len(&self) -> usize
impl<N: Zero + Copy + Clone> DVec<N>
fn new_zeros(dim: usize) -> DVec<N>
fn is_zero(&self) -> bool
Tests if all components of the vector are zeroes.
impl<N> DVec<N>
fn as_slice<'a>(&'a self) -> &'a [N]
Slices this vector.
fn as_mut_slice<'a>(&'a mut self) -> &'a mut [N]
Mutably slices this vector.
impl<N: One + Zero + Copy + Clone> DVec<N>
impl<N: Rand + Zero> DVec<N>
fn new_random(dim: usize) -> DVec<N>
Builds a vector filled with random values.
impl<N: BaseFloat + ApproxEq<N>> DVec<N>
fn canonical_basis_with_dim(dim: usize) -> Vec<DVec<N>>
Computes the canonical basis for the given dimension. A canonical basis is a set of vectors, mutually orthogonal, with all its component equal to 0.0 except one which is equal to 1.0.
fn orthogonal_subspace_basis(&self) -> Vec<DVec<N>>
Computes a basis of the space orthogonal to the vector. If the input vector is of dimension
n
, this will return n - 1
vectors.