pub fn mul_csr_csr<N, I, Iptr>(
    lhs: CsMatViewI<N, I, Iptr>,
    rhs: CsMatViewI<N, I, Iptr>,
) -> CsMatI<N, I, Iptr>
where
    N: Num + Copy + std::ops::AddAssign + Send + Sync,
    I: SpIndex,
    Iptr: SpIndex,
{
    let l_rows = lhs.rows();
    let l_cols = lhs.cols();
    let r_rows = rhs.rows();
    let r_cols = rhs.cols();
    assert_eq!(l_cols, r_rows);
    let workspace_len = l_rows.max(l_cols).max(r_cols);
    #[cfg(feature = "multi_thread")]
    let nb_threads = {
        use self::ThreadingStrategy::{Automatic, AutomaticPhysical};
        match thread_threading_strategy() {
            ThreadingStrategy::Fixed(nb_threads) => nb_threads,
            strat @ Automatic | strat @ AutomaticPhysical => {
                let nb_cpus = if strat == ThreadingStrategy::Automatic {
                    num_cpus::get()
                } else {
                    num_cpus::get_physical()
                };
                let ideal_chunk_size = 8128;
                let wanted_threads = (lhs.nnz() + rhs.nnz()) / ideal_chunk_size;
                1.max(wanted_threads).min(nb_cpus)
            }
        }
    };
    #[cfg(not(feature = "multi_thread"))]
    let nb_threads = 1;
    let mut tmps = Vec::with_capacity(nb_threads);
    for _ in 0..nb_threads {
        tmps.push(vec![N::zero(); workspace_len].into_boxed_slice())
    }
    let mut seens = Vec::with_capacity(nb_threads);
    for _ in 0..nb_threads {
        seens.push(vec![false; workspace_len].into_boxed_slice());
    }
    mul_csr_csr_with_workspace(lhs, rhs, &mut seens, &mut tmps)
}
/// Compute a sparse matrix product using the SMMP routines
///
/// # Panics
///
/// - if `lhs.cols() != rhs.rows()`.
Compute a sparse matrix product using the SMMP routines
Compute a sparse matrix product using the SMMP routines
pub fn mul_csr_csr<N, I, Iptr>(
    lhs: CsMatViewI<N, I, Iptr>,
    rhs: CsMatViewI<N, I, Iptr>,
) -> CsMatI<N, I, Iptr>
where
    N: Num + Copy + std::ops::AddAssign + Send + Sync,
    I: SpIndex,
    Iptr: SpIndex,
{
    let l_rows = lhs.rows();
    let l_cols = lhs.cols();
    let r_rows = rhs.rows();
    let r_cols = rhs.cols();
    assert_eq!(l_cols, r_rows);
    let workspace_len = l_rows.max(l_cols).max(r_cols);
    #[cfg(feature = "multi_thread")]
    let nb_threads = {
        use self::ThreadingStrategy::{Automatic, AutomaticPhysical};
        match thread_threading_strategy() {
            ThreadingStrategy::Fixed(nb_threads) => nb_threads,
            strat @ Automatic | strat @ AutomaticPhysical => {
                let nb_cpus = if strat == ThreadingStrategy::Automatic {
                    num_cpus::get()
                } else {
                    num_cpus::get_physical()
                };
                let ideal_chunk_size = 8128;
                let wanted_threads = (lhs.nnz() + rhs.nnz()) / ideal_chunk_size;
                1.max(wanted_threads).min(nb_cpus)
            }
        }
    };
    #[cfg(not(feature = "multi_thread"))]
    let nb_threads = 1;
    let mut tmps = Vec::with_capacity(nb_threads);
    for _ in 0..nb_threads {
        tmps.push(vec![N::zero(); workspace_len].into_boxed_slice())
    }
    let mut seens = Vec::with_capacity(nb_threads);
    for _ in 0..nb_threads {
        seens.push(vec![false; workspace_len].into_boxed_slice());
    }
    mul_csr_csr_with_workspace(lhs, rhs, &mut seens, &mut tmps)
}
pub fn mul_csr_csr < N , I , Iptr > ( lhs : CsMatViewI < N , I , Iptr > , rhs : CsMatViewI < N , I , Iptr > , ) -> CsMatI < N , I , Iptr > where N : Num + Copy + std :: ops :: AddAssign + Send + Sync , I : SpIndex , Iptr : SpIndex , { let l_rows = lhs . rows ( ) ; let l_cols = lhs . cols ( ) ; let r_rows = rhs . rows ( ) ; let r_cols = rhs . cols ( ) ; assert_eq ! ( l_cols r_rows ) ; let workspace_len = l_rows . max ( l_cols ) . max ( r_cols ) ; # [ cfg ( feature " " ) ] let nb_threads = { use self :: ThreadingStrategy :: { Automatic , AutomaticPhysical } ; match thread_threading_strategy ( ) { ThreadingStrategy :: Fixed ( nb_threads ) => nb_threads , strat @ Automatic | strat @ AutomaticPhysical => { let nb_cpus = if strat == ThreadingStrategy :: Automatic { num_cpus :: get ( ) } else { num_cpus :: get_physical ( ) } ; let ideal_chunk_size = 8128 ; let wanted_threads = ( lhs . nnz ( ) + rhs . nnz ( ) ) / ideal_chunk_size ; 1 . max ( wanted_threads ) . min ( nb_cpus ) } } } ; # [ cfg ( not ( feature " " ) ) ] let nb_threads = 1 ; let mut tmps = Vec :: with_capacity ( nb_threads ) ; for _ in 0 .. nb_threads { tmps . push ( vec ! [ N zero ( ) workspace_len ] . into_boxed_slice ( ) ) } let mut seens = Vec :: with_capacity ( nb_threads ) ; for _ in 0 .. nb_threads { seens . push ( vec ! [ false workspace_len ] . into_boxed_slice ( ) ) ; } mul_csr_csr_with_workspace ( lhs , rhs , & mut seens , & mut tmps ) }
Compute a sparse matrix product using the SMMP routines
Compute a sparse matrix product using the SMMP routines
lhs
CsMatViewI<N, I, Iptr>
rhs
CsMatViewI<N, I, Iptr>
lhs
CsMatViewI<N, I, Iptr>
rhs
CsMatViewI<N, I, Iptr>
panics
None