/// Masks a matrix with the given `matrix`
Masks a matrix with the given `matrix`
Masks a matrix with the given ` matrix `
fn ndarray_mask<A: Scalar>(matrix: ArrayView2<A>, mask: &[bool]) -> Array2<A> {
    assert_eq!(mask.len(), matrix.ncols());
    let indices = (0..mask.len())
        .zip(mask.iter())
        .filter(|(_, b)| **b)
        .map(|(a, _)| a)
        .collect::<Vec<usize>>();
    matrix.select(Axis(1), &indices)
}
fn ndarray_mask < A : Scalar > ( matrix : ArrayView2 < A > , mask : & [ bool ] ) -> Array2 < A > { assert_eq ! ( mask len ( ) matrix ncols ( ) ) ; let indices = ( 0 .. mask . len ( ) ) . zip ( mask . iter ( ) ) . filter ( | ( _ , b ) | * * b ) . map ( | ( a , _ ) | a ) . collect :: < Vec < usize > > ( ) ; matrix . select ( Axis ( 1 ) , & indices ) }
Masks a matrix with the given `matrix`
Masks a matrix with the given ` matrix `
matrix
ArrayView2<A>
mask
&[bool]