Struct na::base::VecStorage [−][src]
A Vec-based matrix data storage. It may be dynamically-sized.
Implementations
impl<N, R, C> VecStorage<N, R, C> where
C: Dim,
R: Dim,
[src]
impl<N, R, C> VecStorage<N, R, C> where
C: Dim,
R: Dim,
[src]pub fn new(nrows: R, ncols: C, data: Vec<N, Global>) -> VecStorage<N, R, C>
[src]
Creates a new dynamic matrix data storage from the given vector and shape.
pub fn as_vec(&self) -> &Vec<N, Global>
[src]
The underlying data storage.
pub unsafe fn as_vec_mut(&mut self) -> &mut Vec<N, Global>
[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, Global>
[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.
pub fn is_empty(&self) -> bool
[src]
Returns true if the underlying vector contains no elements.
Trait Implementations
impl<N, R, C> Clone for VecStorage<N, R, C> where
C: Clone + Dim,
N: Clone,
R: Clone + Dim,
[src]
impl<N, R, C> Clone for VecStorage<N, R, C> where
C: Clone + Dim,
N: Clone,
R: Clone + Dim,
[src]pub fn clone(&self) -> VecStorage<N, R, C>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de, N, R, C> Deserialize<'de> for VecStorage<N, R, C> where
C: Dim + Deserialize<'de>,
N: Deserialize<'de>,
R: Dim + Deserialize<'de>,
[src]
impl<'de, N, R, C> Deserialize<'de> for VecStorage<N, R, C> where
C: Dim + Deserialize<'de>,
N: Deserialize<'de>,
R: Dim + Deserialize<'de>,
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<VecStorage<N, R, C>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<VecStorage<N, R, C>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl<'a, N, R> Extend<&'a N> for VecStorage<N, R, Dynamic> where
N: 'a + Copy,
R: Dim,
[src]
impl<'a, N, R> Extend<&'a N> for VecStorage<N, R, Dynamic> where
N: 'a + Copy,
R: Dim,
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = &'a N>,
[src]
I: IntoIterator<Item = &'a N>,
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, 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, U1>,
ShapeConstraint: SameNumberOfRows<R, RV>,
[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, U1>,
ShapeConstraint: SameNumberOfRows<R, RV>,
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Matrix<N, RV, U1, SV>>,
[src]
I: IntoIterator<Item = Matrix<N, RV, U1, SV>>,
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> Extend<N> for VecStorage<N, Dynamic, U1>
[src]
impl<N> Extend<N> for VecStorage<N, Dynamic, U1>
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
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> Extend<N> for VecStorage<N, R, Dynamic> where
R: Dim,
[src]
impl<N, R> Extend<N> for VecStorage<N, R, Dynamic> where
R: Dim,
[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
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, R, C> PartialEq<VecStorage<N, R, C>> for VecStorage<N, R, C> where
C: PartialEq<C> + Dim,
N: PartialEq<N>,
R: PartialEq<R> + Dim,
[src]
impl<N, R, C> PartialEq<VecStorage<N, R, C>> for VecStorage<N, R, C> where
C: PartialEq<C> + Dim,
N: PartialEq<N>,
R: PartialEq<R> + Dim,
[src]pub fn eq(&self, other: &VecStorage<N, R, C>) -> bool
[src]
pub fn ne(&self, other: &VecStorage<N, R, C>) -> bool
[src]
impl<N, C1, C2> ReshapableStorage<N, Dynamic, C1, Dynamic, C2> for VecStorage<N, Dynamic, C1> where
N: Scalar,
C1: Dim,
C2: Dim,
[src]
impl<N, C1, C2> ReshapableStorage<N, Dynamic, C1, Dynamic, C2> for VecStorage<N, Dynamic, C1> where
N: Scalar,
C1: Dim,
C2: Dim,
[src]type Output = VecStorage<N, Dynamic, C2>
The reshaped storage type.
pub fn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<N, Dynamic, C1> as ReshapableStorage<N, Dynamic, C1, Dynamic, C2>>::Output
[src]
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<N, Dynamic, C1> as ReshapableStorage<N, Dynamic, C1, Dynamic, C2>>::Output
impl<N, C1, R2> ReshapableStorage<N, Dynamic, C1, R2, Dynamic> for VecStorage<N, Dynamic, C1> where
N: Scalar,
C1: Dim,
R2: DimName,
[src]
impl<N, C1, R2> ReshapableStorage<N, Dynamic, C1, R2, Dynamic> for VecStorage<N, Dynamic, C1> where
N: Scalar,
C1: Dim,
R2: DimName,
[src]type Output = VecStorage<N, R2, Dynamic>
The reshaped storage type.
pub fn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<N, Dynamic, C1> as ReshapableStorage<N, Dynamic, C1, R2, Dynamic>>::Output
[src]
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<N, Dynamic, C1> as ReshapableStorage<N, Dynamic, C1, R2, Dynamic>>::Output
impl<N, R1, C2> ReshapableStorage<N, R1, Dynamic, Dynamic, C2> for VecStorage<N, R1, Dynamic> where
N: Scalar,
R1: DimName,
C2: Dim,
[src]
impl<N, R1, C2> ReshapableStorage<N, R1, Dynamic, Dynamic, C2> for VecStorage<N, R1, Dynamic> where
N: Scalar,
R1: DimName,
C2: Dim,
[src]type Output = VecStorage<N, Dynamic, C2>
The reshaped storage type.
pub fn reshape_generic(
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<N, R1, Dynamic> as ReshapableStorage<N, R1, Dynamic, Dynamic, C2>>::Output
[src]
self,
nrows: Dynamic,
ncols: C2
) -> <VecStorage<N, R1, Dynamic> as ReshapableStorage<N, R1, Dynamic, Dynamic, C2>>::Output
impl<N, R1, R2> ReshapableStorage<N, R1, Dynamic, R2, Dynamic> for VecStorage<N, R1, Dynamic> where
N: Scalar,
R1: DimName,
R2: DimName,
[src]
impl<N, R1, R2> ReshapableStorage<N, R1, Dynamic, R2, Dynamic> for VecStorage<N, R1, Dynamic> where
N: Scalar,
R1: DimName,
R2: DimName,
[src]type Output = VecStorage<N, R2, Dynamic>
The reshaped storage type.
pub fn reshape_generic(
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<N, R1, Dynamic> as ReshapableStorage<N, R1, Dynamic, R2, Dynamic>>::Output
[src]
self,
nrows: R2,
ncols: Dynamic
) -> <VecStorage<N, R1, Dynamic> as ReshapableStorage<N, R1, Dynamic, R2, Dynamic>>::Output
impl<N, R, C> Serialize for VecStorage<N, R, C> where
C: Dim + Serialize,
N: Serialize,
R: Dim + Serialize,
[src]
impl<N, R, C> Serialize for VecStorage<N, R, C> where
C: Dim + Serialize,
N: Serialize,
R: Dim + Serialize,
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl<N, C> Storage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]
impl<N, C> Storage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]type RStride = U1
The static stride of this storage’s rows.
type CStride = Dynamic
The static stride of this storage’s columns.
pub fn ptr(&self) -> *const N
[src]
pub fn shape(&self) -> (Dynamic, C)
[src]
pub fn strides(
&self
) -> (<VecStorage<N, Dynamic, C> as Storage<N, Dynamic, C>>::RStride, <VecStorage<N, Dynamic, C> as Storage<N, Dynamic, C>>::CStride)
[src]
&self
) -> (<VecStorage<N, Dynamic, C> as Storage<N, Dynamic, C>>::RStride, <VecStorage<N, Dynamic, C> as Storage<N, Dynamic, C>>::CStride)
pub fn is_contiguous(&self) -> bool
[src]
pub fn into_owned(
self
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
self
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
DefaultAllocator: Allocator<N, Dynamic, C>,
pub fn clone_owned(
&self
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
&self
) -> <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer where
DefaultAllocator: Allocator<N, Dynamic, C>,
pub fn as_slice(&self) -> &[N]ⓘ
[src]
pub fn linear_index(&self, irow: usize, icol: usize) -> usize
[src]
pub unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N
[src]
pub unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N
[src]
pub unsafe fn get_unchecked_linear(&self, i: usize) -> &N
[src]
pub unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
[src]
impl<N, R> Storage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]
impl<N, R> Storage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]type RStride = U1
The static stride of this storage’s rows.
type CStride = R
The static stride of this storage’s columns.
pub fn ptr(&self) -> *const N
[src]
pub fn shape(&self) -> (R, Dynamic)
[src]
pub fn strides(
&self
) -> (<VecStorage<N, R, Dynamic> as Storage<N, R, Dynamic>>::RStride, <VecStorage<N, R, Dynamic> as Storage<N, R, Dynamic>>::CStride)
[src]
&self
) -> (<VecStorage<N, R, Dynamic> as Storage<N, R, Dynamic>>::RStride, <VecStorage<N, R, Dynamic> as Storage<N, R, Dynamic>>::CStride)
pub fn is_contiguous(&self) -> bool
[src]
pub fn into_owned(
self
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
self
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
DefaultAllocator: Allocator<N, R, Dynamic>,
pub fn clone_owned(
&self
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
&self
) -> <DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer where
DefaultAllocator: Allocator<N, R, Dynamic>,
pub fn as_slice(&self) -> &[N]ⓘ
[src]
pub fn linear_index(&self, irow: usize, icol: usize) -> usize
[src]
pub unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N
[src]
pub unsafe fn get_address_unchecked(&self, irow: usize, icol: usize) -> *const N
[src]
pub unsafe fn get_unchecked_linear(&self, i: usize) -> &N
[src]
pub unsafe fn get_unchecked(&self, irow: usize, icol: usize) -> &N
[src]
impl<N, C> StorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]
impl<N, C> StorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]pub fn ptr_mut(&mut self) -> *mut N
[src]
pub fn as_mut_slice(&mut self) -> &mut [N]ⓘ
[src]
pub unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N
[src]
pub unsafe fn get_address_unchecked_mut(
&mut self,
irow: usize,
icol: usize
) -> *mut N
[src]
&mut self,
irow: usize,
icol: usize
) -> *mut N
pub unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N
[src]
pub unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N
[src]
pub unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
[src]
pub 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> StorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]
impl<N, R> StorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]pub fn ptr_mut(&mut self) -> *mut N
[src]
pub fn as_mut_slice(&mut self) -> &mut [N]ⓘ
[src]
pub unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N
[src]
pub unsafe fn get_address_unchecked_mut(
&mut self,
irow: usize,
icol: usize
) -> *mut N
[src]
&mut self,
irow: usize,
icol: usize
) -> *mut N
pub unsafe fn get_unchecked_linear_mut(&mut self, i: usize) -> &mut N
[src]
pub unsafe fn get_unchecked_mut(&mut self, irow: usize, icol: usize) -> &mut N
[src]
pub unsafe fn swap_unchecked_linear(&mut self, i1: usize, i2: usize)
[src]
pub 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, C> ContiguousStorage<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
impl<N, R> ContiguousStorage<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
impl<N, C> ContiguousStorageMut<N, Dynamic, C> for VecStorage<N, Dynamic, C> where
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
[src]
C: Dim,
N: Scalar,
DefaultAllocator: Allocator<N, Dynamic, C>,
<DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer == VecStorage<N, Dynamic, C>,
impl<N, R> ContiguousStorageMut<N, R, Dynamic> for VecStorage<N, R, Dynamic> where
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
[src]
N: Scalar,
R: DimName,
DefaultAllocator: Allocator<N, R, Dynamic>,
<DefaultAllocator as Allocator<N, R, Dynamic>>::Buffer == VecStorage<N, R, Dynamic>,
impl<N, R, C> Eq for VecStorage<N, R, C> where
C: Eq + Dim,
N: Eq,
R: Eq + Dim,
[src]
C: Eq + Dim,
N: Eq,
R: Eq + Dim,
impl<N, R, C> StructuralEq for VecStorage<N, R, C> where
C: Dim,
R: Dim,
[src]
C: Dim,
R: Dim,
impl<N, R, C> StructuralPartialEq for VecStorage<N, R, C> where
C: Dim,
R: Dim,
[src]
C: Dim,
R: Dim,
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<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,