pub fn append(&mut self, ind: usize, val: N) {
        match self.indices.last() {
            None => (),
            Some(&last_ind) => {
                assert!(ind > last_ind.index(), "unsorted append")
            }
        }
        assert!(ind <= self.dim, "out of bounds index");
        self.indices.push(I::from_usize(ind));
        self.data.push(val);
    }
/// 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()`
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.
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 .
pub fn append(&mut self, ind: usize, val: N) {
        match self.indices.last() {
            None => (),
            Some(&last_ind) => {
                assert!(ind > last_ind.index(), "unsorted append")
            }
        }
        assert!(ind <= self.dim, "out of bounds index");
        self.indices.push(I::from_usize(ind));
        self.data.push(val);
    }
pub fn append ( & mut self , ind : usize , val : N ) { match self . indices . last ( ) { None => ( ) , Some ( & last_ind ) => { assert ! ( ind last_ind index ( ) " " ) } } assert ! ( ind self dim " " ) ; self . indices . push ( I :: from_usize ( ind ) ) ; self . data . push ( val ) ; }
Append an element to the sparse vector.
Append an element to the sparse vector .
&mut self
ind
usize
val
N
&mut self
ind
usize
val
N
panics
Panics if `ind` is lower or equal to the last
element of `self.indices()`
Panics if `ind` is greater than `self.dim()`
Panics if ` ind ` is lower or equal to the last element of ` self . indices () ` Panics if ` ind ` is greater than ` self . dim () `