537537CachedIterator {T,IT} (it:: IT , state) where {T,IT} = CachedIterator {T,IT} (it,T[],state,0 )
538538CachedIterator (it:: IT ) where IT = CachedIterator {eltype(it),IT} (it, ())
539539
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+
540544function resize! (it:: CachedIterator{T} ,n:: Integer ) where {T}
541545 m = it. length
542546 if n > m
@@ -668,12 +672,12 @@ conv(x::AbstractFill, y::AbstractFill) = DSP.conv(x, y)
668672# TODO : cache sums
669673
670674
671- struct BlockInterlacer{DMS<: Tuple }
675+ struct BlockInterlacer{DMS<: Tuple{Vararg{AbstractVector{Int}}} }
672676 blocks:: DMS
673677end
674678
675679
676- const TrivialInterlacer{d} = BlockInterlacer{<: NTuple{d,Ones} }
680+ const TrivialInterlacer{d} = BlockInterlacer{<: NTuple{d,Ones{Int} } }
677681
678682BlockInterlacer (v:: AbstractVector ) = BlockInterlacer (Tuple (v))
679683
@@ -685,6 +689,8 @@ length(b::BlockInterlacer) = mapreduce(sum,+,b.blocks)
685689
686690Base. IteratorSize (:: Type{BlockInterlacer{T}} ) where {T} = _IteratorSize (T)
687691
692+ Base. show (io:: IO , B:: BlockInterlacer ) = print (io, BlockInterlacer, " (" , B. blocks, " )" )
693+
688694# the state is always (whichblock,curblock,cursubblock,curcoefficients)
689695# start(it::BlockInterlacer) = (1,1,map(start,it.blocks),ntuple(zero,length(it.blocks)))
690696
0 commit comments