pub type CsVecI<N, I = usize> = CsVecBase<Vec<I>, Vec<N>, N, I>;
Implementations§
source§impl<N, I: SpIndex> CsVecI<N, I>
impl<N, I: SpIndex> CsVecI<N, I>
sourcepub fn empty(dim: usize) -> Self
pub fn empty(dim: usize) -> Self
Create an empty CsVec
, which can be used for incremental construction
sourcepub fn append(&mut self, ind: usize, val: N)
pub fn append(&mut self, ind: usize, val: N)
Append an element to the sparse vector. Used for incremental
building of the CsVec
. The append should preserve the structure
of the vector, ie the newly added index should be strictly greater
than the last element of indices.
Panics
- Panics if
ind
is lower or equal to the last element ofself.indices()
- Panics if
ind
is greater thanself.dim()
sourcepub fn reserve_exact(&mut self, exact_size: usize)
pub fn reserve_exact(&mut self, exact_size: usize)
Reserve exactly exact_size
non-zero values.