Merged some optimizations.

* up

* Removed comments
This commit is contained in:
Ale 2016-12-27 01:14:57 +01:00 committed by GitHub
parent ab6c6b1174
commit 7f5b320db9

View File

@ -1,7 +1,7 @@
use ::kdtree::*;
pub struct Bounds {
pub bounds: Vec<(f64, f64)>,
pub bounds: [(f64,f64);3],
widest_dim : usize,
midvalue_of_widest_dim : f64,
@ -10,13 +10,11 @@ pub struct Bounds {
impl Bounds {
pub fn new_from_points<T: KdtreePointTrait>(points: &Vec<T>) -> Bounds {
let mut bounds = Bounds {
bounds: vec![],
bounds: [(0.,0.),(0.,0.),(0.,0.)],
widest_dim : 0,
midvalue_of_widest_dim : 0.,
};
bounds.bounds.resize(points[0].dims().len(), (0., 0.));
for i in 0..points[0].dims().len() {
bounds.bounds[i].0 = points[0].dims()[i];
bounds.bounds[i].1 = points[0].dims()[i];
@ -108,4 +106,4 @@ mod tests {
assert_eq!(1, bounds.get_widest_dim());
}
}
}