fn classify_items(candidates: &Candidates, best_index: usize, sides: &mut Vec<Side>) {
        let best_dimension = candidates[best_index].dimension();
        for i in 0..(best_index + 1) {
            if candidates[i].dimension() == best_dimension {
                if candidates[i].is_right() {
                    sides[candidates[i].index] = Side::Left;
                } else {
                    sides[candidates[i].index] = Side::Both;
                }
            }
        }
        for i in best_index..candidates.len() {
            if candidates[i].dimension() == best_dimension && candidates[i].is_left() {
                sides[candidates[i].index] = Side::Right;
            }
        }
    }
/// Step 1 of classify.
/// Given a candidate list and a splitting candidate identify wich items are part of the
/// left, right and both subspaces.
Step 1 of classify.
Given a candidate list and a splitting candidate identify wich items are part of the
left, right and both subspaces.
Step 1 of classify . Given a candidate list and a splitting candidate identify wich items are part of the left right and both subspaces .
fn classify_items(candidates: &Candidates, best_index: usize, sides: &mut Vec<Side>) {
        let best_dimension = candidates[best_index].dimension();
        for i in 0..(best_index + 1) {
            if candidates[i].dimension() == best_dimension {
                if candidates[i].is_right() {
                    sides[candidates[i].index] = Side::Left;
                } else {
                    sides[candidates[i].index] = Side::Both;
                }
            }
        }
        for i in best_index..candidates.len() {
            if candidates[i].dimension() == best_dimension && candidates[i].is_left() {
                sides[candidates[i].index] = Side::Right;
            }
        }
    }
fn classify_items ( candidates : & Candidates , best_index : usize , sides : & mut Vec < Side > ) { let best_dimension = candidates [ best_index ] . dimension ( ) ; for i in 0 .. ( best_index + 1 ) { if candidates [ i ] . dimension ( ) == best_dimension { if candidates [ i ] . is_right ( ) { sides [ candidates [ i ] . index ] = Side :: Left ; } else { sides [ candidates [ i ] . index ] = Side :: Both ; } } } for i in best_index .. candidates . len ( ) { if candidates [ i ] . dimension ( ) == best_dimension && candidates [ i ] . is_left ( ) { sides [ candidates [ i ] . index ] = Side :: Right ; } } }
Step 1 of classify.
Step 1 of classify .
candidates
&Candidates
best_index
usize
sides
&mut Vec<Side>