@@ -30,11 +30,11 @@ mod manhattan;
30
30
pub trait Distance : Send + Sync + Sized + Clone + fmt:: Debug + ' static {
31
31
/// A header structure with informations related to the
32
32
type Header : Pod + Zeroable + fmt:: Debug ;
33
- type VectorFormat : UnalignedVectorCodec ;
33
+ type VectorCodec : UnalignedVectorCodec ;
34
34
35
35
fn name ( ) -> & ' static str ;
36
36
37
- fn new_header ( vector : & UnalignedVector < Self :: VectorFormat > ) -> Self :: Header ;
37
+ fn new_header ( vector : & UnalignedVector < Self :: VectorCodec > ) -> Self :: Header ;
38
38
39
39
/// Returns a non-normalized distance.
40
40
fn built_distance ( p : & Leaf < Self > , q : & Leaf < Self > ) -> f32 ;
@@ -59,7 +59,7 @@ pub trait Distance: Send + Sync + Sized + Clone + fmt::Debug + 'static {
59
59
Self :: norm_no_header ( & leaf. vector )
60
60
}
61
61
62
- fn norm_no_header ( v : & UnalignedVector < Self :: VectorFormat > ) -> f32 ;
62
+ fn norm_no_header ( v : & UnalignedVector < Self :: VectorCodec > ) -> f32 ;
63
63
64
64
fn normalize ( node : & mut Leaf < Self > ) {
65
65
let norm = Self :: norm ( node) ;
@@ -84,19 +84,19 @@ pub trait Distance: Send + Sync + Sized + Clone + fmt::Debug + 'static {
84
84
fn create_split < ' a , R : Rng > (
85
85
children : & ' a ImmutableSubsetLeafs < Self > ,
86
86
rng : & mut R ,
87
- ) -> heed:: Result < Cow < ' a , UnalignedVector < Self :: VectorFormat > > > ;
87
+ ) -> heed:: Result < Cow < ' a , UnalignedVector < Self :: VectorCodec > > > ;
88
88
89
89
fn margin ( p : & Leaf < Self > , q : & Leaf < Self > ) -> f32 {
90
90
Self :: margin_no_header ( & p. vector , & q. vector )
91
91
}
92
92
93
93
fn margin_no_header (
94
- p : & UnalignedVector < Self :: VectorFormat > ,
95
- q : & UnalignedVector < Self :: VectorFormat > ,
94
+ p : & UnalignedVector < Self :: VectorCodec > ,
95
+ q : & UnalignedVector < Self :: VectorCodec > ,
96
96
) -> f32 ;
97
97
98
98
fn side < R : Rng > (
99
- normal_plane : & UnalignedVector < Self :: VectorFormat > ,
99
+ normal_plane : & UnalignedVector < Self :: VectorCodec > ,
100
100
node : & Leaf < Self > ,
101
101
rng : & mut R ,
102
102
) -> Side {
0 commit comments