537
537
CachedIterator {T,IT} (it:: IT , state) where {T,IT} = CachedIterator {T,IT} (it,T[],state,0 )
538
538
CachedIterator (it:: IT ) where IT = CachedIterator {eltype(it),IT} (it, ())
539
539
540
+ function Base. show (io:: IO , c:: CachedIterator )
541
+ print (io, " Cached " , c. iterator, " with " , c. length, " stored elements, and state = " , c. state)
542
+ end
543
+
540
544
function resize! (it:: CachedIterator{T} ,n:: Integer ) where {T}
541
545
m = it. length
542
546
if n > m
@@ -668,12 +672,12 @@ conv(x::AbstractFill, y::AbstractFill) = DSP.conv(x, y)
668
672
# TODO : cache sums
669
673
670
674
671
- struct BlockInterlacer{DMS<: Tuple }
675
+ struct BlockInterlacer{DMS<: Tuple{Vararg{AbstractVector{Int}}} }
672
676
blocks:: DMS
673
677
end
674
678
675
679
676
- const TrivialInterlacer{d} = BlockInterlacer{<: NTuple{d,Ones} }
680
+ const TrivialInterlacer{d} = BlockInterlacer{<: NTuple{d,Ones{Int} } }
677
681
678
682
BlockInterlacer (v:: AbstractVector ) = BlockInterlacer (Tuple (v))
679
683
@@ -685,6 +689,8 @@ length(b::BlockInterlacer) = mapreduce(sum,+,b.blocks)
685
689
686
690
Base. IteratorSize (:: Type{BlockInterlacer{T}} ) where {T} = _IteratorSize (T)
687
691
692
+ Base. show (io:: IO , B:: BlockInterlacer ) = print (io, BlockInterlacer, " (" , B. blocks, " )" )
693
+
688
694
# the state is always (whichblock,curblock,cursubblock,curcoefficients)
689
695
# start(it::BlockInterlacer) = (1,1,map(start,it.blocks),ntuple(zero,length(it.blocks)))
690
696
0 commit comments