Struct nalgebra::base::VecStorage [−][src]
A Vec-based matrix data storage. It may be dynamically-sized.
Implementations
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: Clone, R: Clone + Dim, C: Clone + Dim> Clone for VecStorage<N, R, C>
[src]
fn clone(&self) -> VecStorage<N, R, C>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<N: Scalar, C: Dim> ContiguousStorage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
impl<N: Scalar, R: DimName> ContiguousStorage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
impl<N: Scalar, C: Dim> ContiguousStorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
impl<N: Scalar, R: DimName> ContiguousStorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
impl<N: Debug, R: Debug + Dim, C: Debug + Dim> Debug for VecStorage<N, R, C>
[src]
impl<N: Eq, R: Eq + Dim, C: Eq + Dim> Eq for VecStorage<N, R, C>
[src]
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]
N: Scalar,
R: Dim,
RV: Dim,
SV: Storage<N, RV>,
ShapeConstraint: SameNumberOfRows<R, RV>,
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
.
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[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
.
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
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.
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<N, R: Dim, C: Dim> Into<Vec<N, Global>> for VecStorage<N, R, C>
[src]
impl<N: PartialEq, R: PartialEq + Dim, C: PartialEq + Dim> PartialEq<VecStorage<N, R, C>> for VecStorage<N, R, C>
[src]
fn eq(&self, other: &VecStorage<N, R, C>) -> bool
[src]
fn ne(&self, other: &VecStorage<N, R, C>) -> bool
[src]
impl<N: Scalar, C: Dim> Storage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
type RStride = U1
The static stride of this storage’s rows.
type CStride = Dynamic
The static stride of this storage’s columns.
fn ptr(&self) -> *const N
[src]
fn shape(&self) -> (Dynamic, C)
[src]
fn strides(&self) -> (Self::RStride, Self::CStride)
[src]
fn is_contiguous(&self) -> bool
[src]
fn into_owned(self) -> Owned<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
fn clone_owned(&self) -> Owned<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
fn as_slice(&self) -> &[N]ⓘ
[src]
fn linear_index(&self, irow: usize, icol: usize) -> usize
[src]
unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N
[src]
unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N
[src]
unsafe fn get_unchecked_linear(&self, i: usize) -> &N
[src]
unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
[src]
impl<N: Scalar, R: DimName> Storage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
type RStride = U1
The static stride of this storage’s rows.
type CStride = R
The static stride of this storage’s columns.
fn ptr(&self) -> *const N
[src]
fn shape(&self) -> (R, Dynamic)
[src]
fn strides(&self) -> (Self::RStride, Self::CStride)
[src]
fn is_contiguous(&self) -> bool
[src]
fn into_owned(self) -> Owned<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
fn clone_owned(&self) -> Owned<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
fn as_slice(&self) -> &[N]ⓘ
[src]
fn linear_index(&self, irow: usize, icol: usize) -> usize
[src]
unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N
[src]
unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N
[src]
unsafe fn get_unchecked_linear(&self, i: usize) -> &N
[src]
unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
[src]
impl<N: Scalar, C: Dim> StorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C, Buffer = Self>,
fn ptr_mut(&mut self) -> *mut N
[src]
fn as_mut_slice(&mut self) -> &mut [N]ⓘ
[src]
unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N
[src]
unsafe fn get_address_unchecked_mut(
&mut self,
irow: usize,
icol: usize
) -> *mut N
[src]
&mut self,
irow: usize,
icol: usize
) -> *mut N
unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N
[src]
unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N
[src]
unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
[src]
unsafe fn swap_unchecked(
&mut self,
row_col1: (usize, usize),
row_col2: (usize, usize)
)
[src]
&mut self,
row_col1: (usize, usize),
row_col2: (usize, usize)
)
impl<N: Scalar, R: DimName> StorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic, Buffer = Self>,
fn ptr_mut(&mut self) -> *mut N
[src]
fn as_mut_slice(&mut self) -> &mut [N]ⓘ
[src]
unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N
[src]
unsafe fn get_address_unchecked_mut(
&mut self,
irow: usize,
icol: usize
) -> *mut N
[src]
&mut self,
irow: usize,
icol: usize
) -> *mut N
unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N
[src]
unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N
[src]
unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
[src]
unsafe fn swap_unchecked(
&mut self,
row_col1: (usize, usize),
row_col2: (usize, usize)
)
[src]
&mut self,
row_col1: (usize, usize),
row_col2: (usize, usize)
)
impl<N, R: Dim, C: Dim> StructuralEq for VecStorage<N, R, C>
[src]
impl<N, R: Dim, C: Dim> StructuralPartialEq for VecStorage<N, R, C>
[src]
Auto Trait Implementations
impl<N, R, C> RefUnwindSafe for VecStorage<N, R, C> where
C: RefUnwindSafe,
N: RefUnwindSafe,
R: RefUnwindSafe,
C: RefUnwindSafe,
N: RefUnwindSafe,
R: RefUnwindSafe,
impl<N, R, C> Send for VecStorage<N, R, C> where
N: Send,
N: Send,
impl<N, R, C> Sync for VecStorage<N, R, C> where
N: Sync,
N: Sync,
impl<N, R, C> Unpin for VecStorage<N, R, C> where
C: Unpin,
N: Unpin,
R: Unpin,
C: Unpin,
N: Unpin,
R: Unpin,
impl<N, R, C> UnwindSafe for VecStorage<N, R, C> where
C: UnwindSafe,
N: UnwindSafe,
R: UnwindSafe,
C: UnwindSafe,
N: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub unsafe fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,