Struct nalgebra::DVec [] [src]

pub struct DVec<N> {
    pub at: Vec<N>,
}

Heap allocated, dynamically sized vector.

Fields

at: Vec<N>

Components of the vector. Contains as much elements as the vector dimension.

Methods

impl<N> DVec<N>
[src]

unsafe fn new_uninitialized(dim: usize) -> DVec<N>

Creates an uninitialized vec.

impl<N: Clone> DVec<N>
[src]

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>
[src]

fn from_fn<F: FnMut(usize) -> N>(dim: usize, f: F) -> DVec<N>

Builds a vector filled with the results of a function applied to each of its component coordinates.

fn len(&self) -> usize

The vector length.

impl<N: Zero + Copy + Clone> DVec<N>
[src]

fn is_zero(&self) -> bool

Tests if all components of the vector are zeroes.

impl<N: Zero + Copy + Clone> DVec<N>
[src]

fn new_zeros(dim: usize) -> DVec<N>

Builds a vector filled with zeros.

Arguments

  • dim - The dimension of the vector.

impl<N: One + Zero + Copy + Clone> DVec<N>
[src]

fn new_ones(dim: usize) -> DVec<N>

Builds a vector filled with ones.

Arguments

  • dim - The dimension of the vector.

impl<N: Rand + Zero> DVec<N>
[src]

fn new_random(dim: usize) -> DVec<N>

Builds a vector filled with random values.

impl<N: BaseFloat + ApproxEq<N>> DVec<N>
[src]

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.

Trait Implementations

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

type Output = DVec<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: Clone> Clone for DVec<N>
[src]

fn clone(&self) -> DVec<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: Debug> Debug for DVec<N>
[src]

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

Formats the value using the given formatter.

impl<N: PartialEq> PartialEq for DVec<N>
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl<N: Eq> Eq for DVec<N>
[src]

impl<N> FromIterator<N> for DVec<N>
[src]

fn from_iter<I: IntoIterator<Item=N>>(param: I) -> DVec<N>

Creates a value from an iterator. Read more

impl<N> AsRef<[N]> for DVec<N>
[src]

fn as_ref(&self) -> &[N]

Performs the conversion.

impl<N> AsMut<[N]> for DVec<N>
[src]

fn as_mut(&mut self) -> &mut [N]

Performs the conversion.

impl<N> Shape<usize> for DVec<N>
[src]

fn shape(&self) -> usize

Returns the shape of an indexable object.

impl<N: Copy> Indexable<usize, N> for DVec<N>
[src]

fn swap(&mut self, i: usize, j: usize)

Swaps the i-th element of self with its j-th element.

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

Reads the i-th element of self. Read more

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

Writes to the i-th element of self. Read more

impl<N, T> Index<T> for DVec<N> where [N]: Index<T>
[src]

type Output = [N]::Output

The returned type after indexing

fn index(&self, i: T) -> &[N]::Output

The method for the indexing (Foo[Bar]) operation

impl<N, T> IndexMut<T> for DVec<N> where [N]: IndexMut<T>
[src]

fn index_mut(&mut self, i: T) -> &mut [N]::Output

The method for the indexing (Foo[Bar]) operation

impl<N> Iterable<N> for DVec<N>
[src]

fn iter<'l>(&'l self) -> Iter<'l, N>

Gets a vector-like read-only iterator.

impl<N> IterableMut<N> for DVec<N>
[src]

fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N>

Gets a vector-like read-write iterator.

impl<N: Copy + Add<N, Output=N> + Mul<N, Output=N>> Axpy<N> for DVec<N>
[src]

fn axpy(&mut self, a: &N, x: &DVec<N>)

Adds $$a * x$$ to self.

impl<N: Copy + Mul<N, Output=N> + Zero> Mul<DVec<N>> for DVec<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: Copy + Div<N, Output=N> + Zero> Div<DVec<N>> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the / operator

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

The method for the / operator

impl<N: Copy + Add<N, Output=N> + Zero> Add<DVec<N>> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the + operator

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

The method for the + operator

impl<N: Copy + Sub<N, Output=N> + Zero> Sub<DVec<N>> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the - operator

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

The method for the - operator

impl<N: Neg<Output=N> + Zero + Copy> Neg for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the - operator

fn neg(self) -> DVec<N>

The method for the unary - operator

impl<N: BaseNum> Dot<N> for DVec<N>
[src]

fn dot(&self, other: &DVec<N>) -> N

Computes the dot (inner) product of two vectors.

impl<N: BaseFloat> Norm<N> for DVec<N>
[src]

fn sqnorm(&self) -> N

Computes the squared norm of self. Read more

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

Gets the normalized version of a copy of v.

fn normalize_mut(&mut self) -> N

Normalizes self.

fn norm(&self) -> N

Computes the norm of self.

impl<N: BaseFloat + Cast<f64>> Mean<N> for DVec<N>
[src]

fn mean(&self) -> N

Computes the mean of the observations stored by v. Read more

impl<N: ApproxEq<N>> ApproxEq<N> for DVec<N>
[src]

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

Default epsilon for approximation.

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

Default ULPs for approximation.

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

Tests approximate equality using a custom epsilon.

fn approx_eq_ulps(&self, other: &DVec<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: Copy + Mul<N, Output=N> + Zero> Mul<N> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the * operator

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

The method for the * operator

impl<N: Copy + Div<N, Output=N> + Zero> Div<N> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the / operator

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

The method for the / operator

impl<N: Copy + Add<N, Output=N> + Zero> Add<N> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the + operator

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

The method for the + operator

impl<N: Copy + Sub<N, Output=N> + Zero> Sub<N> for DVec<N>
[src]

type Output = DVec<N>

The resulting type after applying the - operator

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

The method for the - operator