pub trait IntoSparseVecIter<'a, N: 'a> {
type IterType;
// Required methods
fn into_sparse_vec_iter(
self,
) -> <Self as IntoSparseVecIter<'a, N>>::IterType
where <Self as IntoSparseVecIter<'a, N>>::IterType: Iterator<Item = (usize, &'a N)>;
fn dim(&self) -> usize;
// Provided methods
fn is_dense(&self) -> bool { ... }
fn index(self, idx: usize) -> &'a N
where Self: Sized { ... }
}Expand description
Trait for types that can be iterated as sparse vectors
Required Associated Types§
Required Methods§
Sourcefn into_sparse_vec_iter(self) -> <Self as IntoSparseVecIter<'a, N>>::IterType
fn into_sparse_vec_iter(self) -> <Self as IntoSparseVecIter<'a, N>>::IterType
Transform self into an iterator that yields (usize, &N) tuples where the usize is the index of the value in the sparse vector. The indices should be sorted.