mirror of
https://github.com/andreytkachenko/kdtree-rust.git
synced 2024-11-29 04:43:36 +04:00
hotfix
This commit is contained in:
parent
19f516bb11
commit
aef4f8c834
@ -12,7 +12,14 @@ pub struct Bounds<F: Float> {
|
|||||||
impl<F: Float> Bounds<F> {
|
impl<F: Float> Bounds<F> {
|
||||||
pub fn new_from_points<T: KdTreePoint<F>>(points: &[T]) -> Bounds<F> {
|
pub fn new_from_points<T: KdTreePoint<F>>(points: &[T]) -> Bounds<F> {
|
||||||
let mut bounds = Bounds {
|
let mut bounds = Bounds {
|
||||||
bounds: Vec::with_capacity(points[0].dims()),
|
bounds: {
|
||||||
|
let dims = points[0].dims();
|
||||||
|
let mut v = Vec::with_capacity(dims);
|
||||||
|
for _ in 0..dims{
|
||||||
|
v.push((F::zero(), F::zero()));
|
||||||
|
}
|
||||||
|
v
|
||||||
|
},
|
||||||
widest_dim: 0,
|
widest_dim: 0,
|
||||||
midvalue_of_widest_dim: F::zero(),
|
midvalue_of_widest_dim: F::zero(),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user