File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use alloc::vec::Vec;
13
13
14
14
use super :: axes_of;
15
15
use super :: conversion:: Convert ;
16
+ use super :: ops:: DimAdd ;
16
17
use super :: { stride_offset, stride_offset_checked} ;
17
18
use crate :: itertools:: { enumerate, zip} ;
18
19
use crate :: { Axis , DimMax } ;
@@ -51,6 +52,12 @@ pub trait Dimension:
51
52
+ DimMax < IxDyn , Output =IxDyn >
52
53
+ DimMax < <Self as Dimension >:: Smaller , Output =Self >
53
54
+ DimMax < <Self as Dimension >:: Larger , Output =<Self as Dimension >:: Larger >
55
+ + DimAdd < Self >
56
+ + DimAdd < <Self as Dimension >:: Smaller >
57
+ + DimAdd < <Self as Dimension >:: Larger >
58
+ + DimAdd < Ix0 , Out = Self >
59
+ + DimAdd < Ix1 , Out = <Self as Dimension >:: Larger >
60
+ + DimAdd < IxDyn , Out = IxDyn >
54
61
{
55
62
/// For fixed-size dimension representations (e.g. `Ix2`), this should be
56
63
/// `Some(ndim)`, and for variable-size dimension representations (e.g.
Original file line number Diff line number Diff line change 1
1
use crate :: imp_prelude:: * ;
2
2
3
3
/// Adds the two dimensions at compile time.
4
- pub trait DimAdd < D : Dimension > : Dimension {
4
+ pub trait DimAdd < D : Dimension > {
5
5
/// The sum of the two dimensions.
6
6
type Out : Dimension ;
7
7
}
Original file line number Diff line number Diff line change @@ -661,14 +661,14 @@ pub trait SliceArg {
661
661
/// Number of dimensions that this slicing argument produces in the output array.
662
662
type OutDim : Dimension ;
663
663
664
- fn next_in_dim < D > ( & self , _: PhantomData < D > ) -> PhantomData < D :: Out >
664
+ fn next_in_dim < D > ( & self , _: PhantomData < D > ) -> PhantomData < < D as DimAdd < Self :: InDim > > :: Out >
665
665
where
666
666
D : Dimension + DimAdd < Self :: InDim > ,
667
667
{
668
668
PhantomData
669
669
}
670
670
671
- fn next_out_dim < D > ( & self , _: PhantomData < D > ) -> PhantomData < D :: Out >
671
+ fn next_out_dim < D > ( & self , _: PhantomData < D > ) -> PhantomData < < D as DimAdd < Self :: OutDim > > :: Out >
672
672
where
673
673
D : Dimension + DimAdd < Self :: OutDim > ,
674
674
{
You can’t perform that action at this time.
0 commit comments