// helper function -- normalize self.scores
helper function -- normalize self.scores
helper function -- normalize self . scores
fn normalize(&mut self) {
        for i in 0..self.len() {
            let mut tot: f32 = 0.0;
            // FIXME: slices would be cleaner
            for base_i in 0..20 {
                tot += self.scores[[i, base_i]];
            }
            for base_i in 0..20 {
                self.scores[[i, base_i]] /= tot;
            }
        }
    }
fn normalize ( & mut self ) { for i in 0 .. self . len ( ) { let mut tot : f32 = 0.0 ; // FIXME: slices would be cleaner for base_i in 0 .. 20 { tot += self . scores [ [ i , base_i ] ] ; } for base_i in 0 .. 20 { self . scores [ [ i , base_i ] ] /= tot ; } } }
helper function -- normalize self.scores
helper function -- normalize self . scores
&mut self