Struct sprs::TriMatIter[][src]

pub struct TriMatIter<RI, CI, DI> { /* fields omitted */ }

An iterator over elements of a sparse matrix, in the triplet format

The dataypes RI, CI, and DI are iterators yielding the row, column and values of non-zero entries.

As in TriMat, no order guarantee is provided and the same location can appear multiple times. The non-zero value is then considered as the sum of all the entries sharing its location.

Implementations

impl<'a, N, I, RI, CI, DI> TriMatIter<RI, CI, DI> where
    I: 'a + SpIndex,
    N: 'a,
    RI: Iterator<Item = &'a I>,
    CI: Iterator<Item = &'a I>,
    DI: Iterator<Item = &'a N>, 
[src]

pub fn new(
    shape: (usize, usize),
    nnz: usize,
    row_inds: RI,
    col_inds: CI,
    data: DI
) -> Self
[src]

Create a new TriMatIter from iterators

pub fn rows(&self) -> usize[src]

The number of rows of the matrix

pub fn cols(&self) -> usize[src]

The number of cols of the matrix

pub fn shape(&self) -> (usize, usize)[src]

The shape of the matrix, as a (rows, cols) tuple

pub fn nnz(&self) -> usize[src]

The number of non-zero entries

pub fn into_row_inds(self) -> RI[src]

pub fn into_col_inds(self) -> CI[src]

pub fn into_data(self) -> DI[src]

pub fn transpose_into(self) -> TriMatIter<CI, RI, DI>

Notable traits for TriMatIter<RI, CI, DI>

impl<'a, N, I, RI, CI, DI> Iterator for TriMatIter<RI, CI, DI> where
    I: 'a + SpIndex,
    N: 'a,
    RI: Iterator<Item = &'a I>,
    CI: Iterator<Item = &'a I>,
    DI: Iterator<Item = &'a N>, 
type Item = (&'a N, (I, I));
[src]

impl<'a, N, I, RI, CI, DI> TriMatIter<RI, CI, DI> where
    I: 'a + SpIndex,
    N: 'a + Clone,
    RI: Clone + Iterator<Item = &'a I>,
    CI: Clone + Iterator<Item = &'a I>,
    DI: Clone + Iterator<Item = &'a N>, 
[src]

pub fn into_csc<Iptr: SpIndex>(self) -> CsMatI<N, I, Iptr> where
    N: Num
[src]

Consume TriMatIter and produce a CSC matrix

pub fn into_csr<Iptr: SpIndex>(self) -> CsMatI<N, I, Iptr> where
    N: Num
[src]

Consume TriMatIter and produce a CSR matrix

pub fn into_cs<Iptr: SpIndex>(
    self,
    storage: CompressedStorage
) -> CsMatI<N, I, Iptr> where
    N: Num
[src]

Consume TriMatIter and produce a CsMat matrix with the chosen storage

Trait Implementations

impl<RI: Clone, CI: Clone, DI: Clone> Clone for TriMatIter<RI, CI, DI>[src]

impl<RI: Debug, CI: Debug, DI: Debug> Debug for TriMatIter<RI, CI, DI>[src]

impl<'a, N, I, RI, CI, DI> Iterator for TriMatIter<RI, CI, DI> where
    I: 'a + SpIndex,
    N: 'a,
    RI: Iterator<Item = &'a I>,
    CI: Iterator<Item = &'a I>,
    DI: Iterator<Item = &'a N>, 
[src]

type Item = (&'a N, (I, I))

The type of the elements being iterated over.

impl<RI: PartialEq, CI: PartialEq, DI: PartialEq> PartialEq<TriMatIter<RI, CI, DI>> for TriMatIter<RI, CI, DI>[src]

impl<RI, CI, DI> StructuralPartialEq for TriMatIter<RI, CI, DI>[src]

Auto Trait Implementations

impl<RI, CI, DI> RefUnwindSafe for TriMatIter<RI, CI, DI> where
    CI: RefUnwindSafe,
    DI: RefUnwindSafe,
    RI: RefUnwindSafe

impl<RI, CI, DI> Send for TriMatIter<RI, CI, DI> where
    CI: Send,
    DI: Send,
    RI: Send

impl<RI, CI, DI> Sync for TriMatIter<RI, CI, DI> where
    CI: Sync,
    DI: Sync,
    RI: Sync

impl<RI, CI, DI> Unpin for TriMatIter<RI, CI, DI> where
    CI: Unpin,
    DI: Unpin,
    RI: Unpin

impl<RI, CI, DI> UnwindSafe for TriMatIter<RI, CI, DI> where
    CI: UnwindSafe,
    DI: UnwindSafe,
    RI: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.