File tree Expand file tree Collapse file tree 3 files changed +21
-18
lines changed
vortex-compute/src/take/vector Expand file tree Collapse file tree 3 files changed +21
-18
lines changed Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: Apache-2.0
22// SPDX-FileCopyrightText: Copyright the Vortex contributors
33
4+ use vortex_vector:: match_each_unsigned_pvector;
5+ use vortex_vector:: primitive:: PVector ;
6+ use vortex_vector:: primitive:: PrimitiveVector ;
7+
8+ use crate :: take:: Take ;
9+
10+ mod bool;
411mod primitive;
512mod pvector;
13+
14+ impl < T > Take < PrimitiveVector > for & T
15+ where
16+ for < ' a > & ' a T : Take < PVector < u8 > , Output = T > ,
17+ for < ' a > & ' a T : Take < PVector < u16 > , Output = T > ,
18+ for < ' a > & ' a T : Take < PVector < u32 > , Output = T > ,
19+ for < ' a > & ' a T : Take < PVector < u64 > , Output = T > ,
20+ {
21+ type Output = T ;
22+
23+ fn take ( self , indices : & PrimitiveVector ) -> T {
24+ match_each_unsigned_pvector ! ( indices, |iv| { self . take( iv) } )
25+ }
26+ }
Original file line number Diff line number Diff line change @@ -9,14 +9,6 @@ use vortex_vector::primitive::PrimitiveVector;
99
1010use crate :: take:: Take ;
1111
12- impl Take < PrimitiveVector > for & PrimitiveVector {
13- type Output = PrimitiveVector ;
14-
15- fn take ( self , indices : & PrimitiveVector ) -> PrimitiveVector {
16- match_each_pvector ! ( self , |v| { v. take( indices) . into( ) } )
17- }
18- }
19-
2012impl < I : UnsignedPType > Take < PVector < I > > for & PrimitiveVector {
2113 type Output = PrimitiveVector ;
2214
Original file line number Diff line number Diff line change 44use vortex_dtype:: NativePType ;
55use vortex_dtype:: UnsignedPType ;
66use vortex_vector:: VectorOps ;
7- use vortex_vector:: match_each_unsigned_pvector;
87use vortex_vector:: primitive:: PVector ;
9- use vortex_vector:: primitive:: PrimitiveVector ;
108
119use crate :: take:: Take ;
1210
13- impl < T : NativePType > Take < PrimitiveVector > for & PVector < T > {
14- type Output = PVector < T > ;
15-
16- fn take ( self , indices : & PrimitiveVector ) -> PVector < T > {
17- match_each_unsigned_pvector ! ( indices, |iv| { self . take( iv) } )
18- }
19- }
20-
2111impl < T : NativePType , I : UnsignedPType > Take < PVector < I > > for & PVector < T > {
2212 type Output = PVector < T > ;
2313
You can’t perform that action at this time.
0 commit comments