/// Calculate the less array for a given BWT. Complexity O(n).
Calculate the less array for a given BWT.
Calculate the less array for a given BWT .
pub fn less(bwt: &BWTSlice, alphabet: &Alphabet) -> Less {
    let m = alphabet
        .max_symbol()
        .expect("Expecting non-empty alphabet.") as usize
        + 2;
    let mut less: Less = repeat(0).take(m).collect();
    for &c in bwt.iter() {
        less[c as usize] += 1;
    }
    // calculate +-prescan
    prescan(&mut less[..], 0, |a, b| a + b);
    less
}
pub fn less ( bwt : & BWTSlice , alphabet : & Alphabet ) -> Less { let m = alphabet . max_symbol ( ) . expect ( " " ) as usize + 2 ; let mut less : Less = repeat ( 0 ) . take ( m ) . collect ( ) ; for & c in bwt . iter ( ) { less [ c as usize ] += 1 ; } // calculate +-prescan prescan ( & mut less [ .. ] , 0 , | a , b | a + b ) ; less }
Calculate the less array for a given BWT.
Calculate the less array for a given BWT .
bwt
&BWTSlice
alphabet
&Alphabet