1
+ use deepsize:: DeepSizeOf ;
1
2
use crate :: lsh:: * ;
2
3
use crate :: types:: * ;
3
4
use packed_simd:: u64x2;
@@ -15,7 +16,7 @@ pub trait Sketcher {
15
16
fn sketch ( & self , v : & Self :: Input ) -> Self :: Output ;
16
17
}
17
18
18
- pub trait BitBasedSketch : Clone + Copy {
19
+ pub trait BitBasedSketch : Clone + Copy + DeepSizeOf {
19
20
fn different_bits ( & self , other : & Self ) -> u32 ;
20
21
fn same_bits ( & self , other : & Self ) -> u32 ;
21
22
fn num_bits ( & self ) -> usize ;
@@ -32,7 +33,7 @@ pub trait FromCosine: Sized {
32
33
}
33
34
34
35
/// A 0-bits sketch
35
- #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq ) ]
36
+ #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq , DeepSizeOf ) ]
36
37
pub struct Sketch0 ;
37
38
38
39
impl BitBasedSketch for Sketch0 {
84
85
}
85
86
}
86
87
87
- #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq ) ]
88
+ #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq , DeepSizeOf ) ]
88
89
pub struct Sketch64 {
89
90
data : u64 ,
90
91
}
@@ -142,7 +143,7 @@ where
142
143
}
143
144
}
144
145
145
- #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq ) ]
146
+ #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq , DeepSizeOf ) ]
146
147
pub struct Sketch128 {
147
148
data : [ u64 ; 2 ] ,
148
149
}
@@ -270,7 +271,7 @@ where
270
271
}
271
272
}
272
273
273
- #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq ) ]
274
+ #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq , DeepSizeOf ) ]
274
275
pub struct Sketch256 {
275
276
data : [ u64 ; 4 ] ,
276
277
}
@@ -357,7 +358,7 @@ where
357
358
}
358
359
}
359
360
360
- #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq ) ]
361
+ #[ derive( Debug , Clone , Copy , Abomonation , Hash , Eq , PartialEq , DeepSizeOf ) ]
361
362
pub struct Sketch512 {
362
363
data : [ u64 ; 8 ] ,
363
364
}
0 commit comments