pub(crate) fn tsvcolors(&self) -> (Vec<u32>, u32) {
        assert!(self.istsv());
        let is_dense = self.is_dense.as_ref().unwrap();
        let mut colors = vec![std::u32::MAX; self.nsparse()];
        let ncolors: u32 = (self.feature_idxs.len() - self.ndense())
            .try_into()
            .unwrap();
        let mut ctr = 0;
        for (i, features) in self.feature_idxs.iter().enumerate() {
            let dense = is_dense.get(i).copied().unwrap_or(false);
            if dense {
                continue;
            }
            for &feature_idx in features.values() {
                let feature_idx = feature_idx as usize;
                assert!(colors[feature_idx] == std::u32::MAX);
                colors[feature_idx] = ctr;
            }
            ctr += 1;
        }
        assert!(ctr == ncolors);
        assert!(colors.iter().max().unwrap() + 1 == ncolors as u32);
        (colors, ncolors)
    }
/// For tsv only, computes the "free" coloring we get
/// from each sparse input column.
For tsv only, computes the "free" coloring we get
from each sparse input column.
For tsv only computes the " free " coloring we get from each sparse input column .
pub(crate) fn tsvcolors(&self) -> (Vec<u32>, u32) {
        assert!(self.istsv());
        let is_dense = self.is_dense.as_ref().unwrap();
        let mut colors = vec![std::u32::MAX; self.nsparse()];
        let ncolors: u32 = (self.feature_idxs.len() - self.ndense())
            .try_into()
            .unwrap();
        let mut ctr = 0;
        for (i, features) in self.feature_idxs.iter().enumerate() {
            let dense = is_dense.get(i).copied().unwrap_or(false);
            if dense {
                continue;
            }
            for &feature_idx in features.values() {
                let feature_idx = feature_idx as usize;
                assert!(colors[feature_idx] == std::u32::MAX);
                colors[feature_idx] = ctr;
            }
            ctr += 1;
        }
        assert!(ctr == ncolors);
        assert!(colors.iter().max().unwrap() + 1 == ncolors as u32);
        (colors, ncolors)
    }
pub ( crate ) fn tsvcolors ( & self ) -> ( Vec < u32 > , u32 ) { assert ! ( self istsv ( ) ) ; let is_dense = self . is_dense . as_ref ( ) . unwrap ( ) ; let mut colors = vec ! [ std u32 MAX self nsparse ( ) ] ; let ncolors : u32 = ( self . feature_idxs . len ( ) - self . ndense ( ) ) . try_into ( ) . unwrap ( ) ; let mut ctr = 0 ; for ( i , features ) in self . feature_idxs . iter ( ) . enumerate ( ) { let dense = is_dense . get ( i ) . copied ( ) . unwrap_or ( false ) ; if dense { continue ; } for & feature_idx in features . values ( ) { let feature_idx = feature_idx as usize ; assert ! ( colors [ feature_idx ] std u32 MAX ) ; colors [ feature_idx ] = ctr ; } ctr += 1 ; } assert ! ( ctr ncolors ) ; assert ! ( colors iter ( ) max ( ) unwrap ( ) 1 ncolors as u32 ) ; ( colors , ncolors ) }
For tsv only, computes the "free" coloring we get
from each sparse input column.
For tsv only computes the " free " coloring we get from each sparse input column .
&self
&self