/// Calculate the bwtfind array needed for inverting the BWT. Complexity O(n).
Calculate the bwtfind array needed for inverting the BWT.
Calculate the bwtfind array needed for inverting the BWT .
pub fn bwtfind(bwt: &BWTSlice, alphabet: &Alphabet) -> BWTFind {
    let n = bwt.len();
    let mut less = less(bwt, alphabet);
    let mut bwtfind: BWTFind = repeat(0).take(n).collect();
    for (r, &c) in bwt.iter().enumerate() {
        bwtfind[less[c as usize]] = r;
        less[c as usize] += 1;
    }
    bwtfind
}
pub fn bwtfind ( bwt : & BWTSlice , alphabet : & Alphabet ) -> BWTFind { let n = bwt . len ( ) ; let mut less = less ( bwt , alphabet ) ; let mut bwtfind : BWTFind = repeat ( 0 ) . take ( n ) . collect ( ) ; for ( r , & c ) in bwt . iter ( ) . enumerate ( ) { bwtfind [ less [ c as usize ] ] = r ; less [ c as usize ] += 1 ; } bwtfind }
Calculate the bwtfind array needed for inverting the BWT.
Calculate the bwtfind array needed for inverting the BWT .
bwt
&BWTSlice
alphabet
&Alphabet