Type Definition sprs::CsVecI[][src]

type CsVecI<N, I = usize> = CsVecBase<Vec<I>, Vec<N>, N, I>;

Implementations

impl<N, I: SpIndex> CsVecI<N, I>[src]

pub fn empty(dim: usize) -> Self[src]

Create an empty CsVec, which can be used for incremental construction

pub fn append(&mut self, ind: usize, val: N)[src]

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 of self.indices()
  • Panics if ind is greater than self.dim()

pub fn reserve(&mut self, size: usize)[src]

Reserve size additional non-zero values.

pub fn reserve_exact(&mut self, exact_size: usize)[src]

Reserve exactly exact_size non-zero values.

pub fn clear(&mut self)[src]

Clear the underlying storage

Trait Implementations

impl<N, I> AbstractGroup<Additive> for CsVecI<N, I> where
    N: Num + Copy + for<'r> AddAssign<&'r N> + Neg<Output = N>,
    I: SpIndex
[src]

impl<N, I> AbstractGroupAbelian<Additive> for CsVecI<N, I> where
    N: Num + Copy + for<'r> AddAssign<&'r N> + Neg<Output = N>,
    I: SpIndex
[src]

impl<N, I> AbstractLoop<Additive> for CsVecI<N, I> where
    N: Num + Copy + for<'r> AddAssign<&'r N> + Neg<Output = N>,
    I: SpIndex
[src]

impl<N, I> AbstractMagma<Additive> for CsVecI<N, I> where
    N: Num + Clone + for<'r> AddAssign<&'r N>,
    I: SpIndex
[src]

impl<N, I> AbstractMonoid<Additive> for CsVecI<N, I> where
    N: Num + Copy + for<'r> AddAssign<&'r N>,
    I: SpIndex
[src]

impl<N, I> AbstractQuasigroup<Additive> for CsVecI<N, I> where
    N: Num + Clone + for<'r> AddAssign<&'r N> + Neg<Output = N>,
    I: SpIndex
[src]

impl<N, I> AbstractSemigroup<Additive> for CsVecI<N, I> where
    N: Num + Clone + for<'r> AddAssign<&'r N>,
    I: SpIndex
[src]

impl<N, I> Identity<Additive> for CsVecI<N, I> where
    N: Num + Clone + for<'r> AddAssign<&'r N>,
    I: SpIndex
[src]

impl<N: Num + Clone + Neg<Output = N>, I: SpIndex> Neg for CsVecI<N, I>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N, I> TwoSidedInverse<Additive> for CsVecI<N, I> where
    N: Clone + Neg<Output = N> + Num,
    I: SpIndex
[src]

impl<N, I> Zero for CsVecI<N, I> where
    N: Num + Clone + for<'r> AddAssign<&'r N>,
    I: SpIndex
[src]