@@ -24,7 +24,7 @@ use crate::Ix1;
2424use super :: { NdProducer , RemoveAxis } ;
2525
2626pub use self :: chunks:: { ExactChunks , ExactChunksIter , ExactChunksIterMut , ExactChunksMut } ;
27- pub use self :: lanes:: { Lanes , LanesMut } ;
27+ pub use self :: lanes:: { Lanes , LanesMut , LanesIter , LanesIterMut } ;
2828pub use self :: windows:: Windows ;
2929pub ( crate ) use self :: trusted:: { to_vec, to_vec_mapped} ;
3030
@@ -742,94 +742,6 @@ where
742742 }
743743}
744744
745- /// An iterator that traverses over all axes but one, and yields a view for
746- /// each lane along that axis.
747- ///
748- /// See [`.lanes()`](../struct.ArrayBase.html#method.lanes) for more information.
749- pub struct LanesIter < ' a , A , D > {
750- inner_len : Ix ,
751- inner_stride : Ixs ,
752- iter : Baseiter < A , D > ,
753- life : PhantomData < & ' a A > ,
754- }
755-
756- clone_bounds ! (
757- [ ' a, A , D : Clone ]
758- LanesIter [ ' a, A , D ] {
759- @copy {
760- inner_len,
761- inner_stride,
762- life,
763- }
764- iter,
765- }
766- ) ;
767-
768- impl < ' a , A , D > Iterator for LanesIter < ' a , A , D >
769- where
770- D : Dimension ,
771- {
772- type Item = ArrayView < ' a , A , Ix1 > ;
773- fn next ( & mut self ) -> Option < Self :: Item > {
774- self . iter . next ( ) . map ( |ptr| unsafe {
775- ArrayView :: new_ ( ptr, Ix1 ( self . inner_len ) , Ix1 ( self . inner_stride as Ix ) )
776- } )
777- }
778-
779- fn size_hint ( & self ) -> ( usize , Option < usize > ) {
780- self . iter . size_hint ( )
781- }
782- }
783-
784- impl < ' a , A , D > ExactSizeIterator for LanesIter < ' a , A , D >
785- where
786- D : Dimension ,
787- {
788- fn len ( & self ) -> usize {
789- self . iter . len ( )
790- }
791- }
792-
793- // NOTE: LanesIterMut is a mutable iterator and must not expose aliasing
794- // pointers. Due to this we use an empty slice for the raw data (it's unused
795- // anyway).
796- /// An iterator that traverses over all dimensions but the innermost,
797- /// and yields each inner row (mutable).
798- ///
799- /// See [`.lanes_mut()`](../struct.ArrayBase.html#method.lanes_mut)
800- /// for more information.
801- pub struct LanesIterMut < ' a , A , D > {
802- inner_len : Ix ,
803- inner_stride : Ixs ,
804- iter : Baseiter < A , D > ,
805- life : PhantomData < & ' a mut A > ,
806- }
807-
808- impl < ' a , A , D > Iterator for LanesIterMut < ' a , A , D >
809- where
810- D : Dimension ,
811- {
812- type Item = ArrayViewMut < ' a , A , Ix1 > ;
813- fn next ( & mut self ) -> Option < Self :: Item > {
814- self . iter . next ( ) . map ( |ptr| unsafe {
815- ArrayViewMut :: new_ ( ptr, Ix1 ( self . inner_len ) , Ix1 ( self . inner_stride as Ix ) )
816- } )
817- }
818-
819- fn size_hint ( & self ) -> ( usize , Option < usize > ) {
820- self . iter . size_hint ( )
821- }
822- }
823-
824- impl < ' a , A , D > ExactSizeIterator for LanesIterMut < ' a , A , D >
825- where
826- D : Dimension ,
827- {
828- fn len ( & self ) -> usize {
829- self . iter . len ( )
830- }
831- }
832-
833745#[ derive( Debug ) ]
834746struct AxisIterCore < A , D > {
835747 /// Index along the axis of the value of `.next()`, relative to the start
0 commit comments