[][src]Struct nalgebra::base::VecStorage

#[repr(C)]
pub struct VecStorage<N, R: Dim, C: Dim> { /* fields omitted */ }

A Vec-based matrix data storage. It may be dynamically-sized.

Methods

impl<N, R: Dim, C: Dim> VecStorage<N, R, C>[src]

pub fn new(nrows: R, ncols: C, data: Vec<N>) -> Self[src]

Creates a new dynamic matrix data storage from the given vector and shape.

pub fn as_vec(&self) -> &Vec<N>[src]

The underlying data storage.

pub unsafe fn as_vec_mut(&mut self) -> &mut Vec<N>[src]

The underlying mutable data storage.

This is unsafe because this may cause UB if the size of the vector is changed by the user.

pub unsafe fn resize(self, sz: usize) -> Vec<N>[src]

Resizes the underlying mutable data storage and unwraps it.

If sz is larger than the current size, additional elements are uninitialized. If sz is smaller than the current size, additional elements are truncated.

pub fn len(&self) -> usize[src]

The number of elements on the underlying vector.

Trait Implementations

impl<N: Scalar, C: Dim> Storage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

type RStride = U1

The static stride of this storage's rows.

type CStride = Dynamic

The static stride of this storage's columns.

fn linear_index(&self, irow: usize, icol: usize) -> usize[src]

Compute the index corresponding to the irow-th row and icol-th column of this matrix. The index must be such that the following holds: Read more

unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N[src]

Gets the address of the i-th matrix component without performing bound-checking.

unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N[src]

Gets the address of the i-th matrix component without performing bound-checking.

unsafe fn get_unchecked_linear(&self, i: usize) -> &N[src]

Retrieves a reference to the i-th element without bound-checking.

unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N[src]

Retrieves a reference to the i-th element without bound-checking.

impl<N: Scalar, R: DimName> Storage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

type RStride = U1

The static stride of this storage's rows.

type CStride = R

The static stride of this storage's columns.

fn linear_index(&self, irow: usize, icol: usize) -> usize[src]

Compute the index corresponding to the irow-th row and icol-th column of this matrix. The index must be such that the following holds: Read more

unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N[src]

Gets the address of the i-th matrix component without performing bound-checking.

unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N[src]

Gets the address of the i-th matrix component without performing bound-checking.

unsafe fn get_unchecked_linear(&self, i: usize) -> &N[src]

Retrieves a reference to the i-th element without bound-checking.

unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N[src]

Retrieves a reference to the i-th element without bound-checking.

impl<N: Scalar, C: Dim> StorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

unsafe fn get_address_unchecked_mut(
    &mut self,
    irow: usize,
    icol: usize
) -> *mut N
[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N[src]

Retrieves a mutable reference to the i-th element without bound-checking.

unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N[src]

Retrieves a mutable reference to the element at (irow, icol) without bound-checking.

unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)[src]

Swaps two elements using their linear index without bound-checking.

unsafe fn swap_unchecked(
    &mut self,
    row_col1: (usize, usize),
    row_col2: (usize, usize)
)
[src]

Swaps two elements without bound-checking.

impl<N: Scalar, R: DimName> StorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

unsafe fn get_address_unchecked_mut(
    &mut self,
    irow: usize,
    icol: usize
) -> *mut N
[src]

Gets the mutable address of the i-th matrix component without performing bound-checking.

unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N[src]

Retrieves a mutable reference to the i-th element without bound-checking.

unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N[src]

Retrieves a mutable reference to the element at (irow, icol) without bound-checking.

unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)[src]

Swaps two elements using their linear index without bound-checking.

unsafe fn swap_unchecked(
    &mut self,
    row_col1: (usize, usize),
    row_col2: (usize, usize)
)
[src]

Swaps two elements without bound-checking.

impl<N: Scalar, C: Dim> ContiguousStorage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

impl<N: Scalar, R: DimName> ContiguousStorage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

impl<N: Scalar, C: Dim> ContiguousStorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
    DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>, 
[src]

impl<N: Scalar, R: DimName> ContiguousStorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
    DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>, 
[src]

impl<N: Clone, R: Clone + Dim, C: Clone + Dim> Clone for VecStorage<N, R, C>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: Eq, R: Eq + Dim, C: Eq + Dim> Eq for VecStorage<N, R, C>[src]

impl<N, R: Dim, C: Dim> Into<Vec<N>> for VecStorage<N, R, C>[src]

impl<N, R: Dim> Extend<N> for VecStorage<N, R, Dynamic>[src]

fn extend<I: IntoIterator<Item = N>>(&mut self, iter: I)[src]

Extends the number of columns of the VecStorage with elements from the given iterator.

Panics

This function panics if the number of elements yielded by the given iterator is not a multiple of the number of rows of the VecStorage.

impl<N, R, RV, SV> Extend<Matrix<N, RV, U1, SV>> for VecStorage<N, R, Dynamic> where
    N: Scalar,
    R: Dim,
    RV: Dim,
    SV: Storage<N, RV>,
    ShapeConstraint: SameNumberOfRows<R, RV>, 
[src]

fn extend<I: IntoIterator<Item = Vector<N, RV, SV>>>(&mut self, iter: I)[src]

Extends the number of columns of the VecStorage with vectors from the given iterator.

Panics

This function panics if the number of rows of each Vector yielded by the iterator is not equal to the number of rows of this VecStorage.

impl<N> Extend<N> for VecStorage<N, Dynamic, U1>[src]

fn extend<I: IntoIterator<Item = N>>(&mut self, iter: I)[src]

Extends the number of rows of the VecStorage with elements from the given iterator.

impl<N: PartialEq, R: PartialEq + Dim, C: PartialEq + Dim> PartialEq<VecStorage<N, R, C>> for VecStorage<N, R, C>[src]

impl<N: Debug, R: Debug + Dim, C: Debug + Dim> Debug for VecStorage<N, R, C>[src]

Auto Trait Implementations

impl<N, R, C> Send for VecStorage<N, R, C> where
    N: Send

impl<N, R, C> Sync for VecStorage<N, R, C> where
    N: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Same for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]