@@ -192,65 +192,6 @@ function Base.getindex(
192192 return blocks (a)[Int (Block (I))]
193193end
194194
195- # Outputs a `BlockUnitRange`.
196- function sub_axis (a:: AbstractUnitRange , indices)
197- return error (" Not implemented" )
198- end
199-
200- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
201- # Outputs a `BlockUnitRange`.
202- function sub_axis (a:: AbstractUnitRange , indices:: AbstractUnitRange )
203- return only (axes (blockedunitrange_getindices (a, indices)))
204- end
205-
206- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
207- # Outputs a `BlockUnitRange`.
208- function sub_axis (a:: AbstractUnitRange , indices:: BlockSlice{<:BlockRange{1}} )
209- return sub_axis (a, indices. block)
210- end
211-
212- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
213- # Outputs a `BlockUnitRange`.
214- function sub_axis (a:: AbstractUnitRange , indices:: BlockSlice{<:Block{1}} )
215- return sub_axis (a, Block (indices))
216- end
217-
218- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
219- # Outputs a `BlockUnitRange`.
220- function sub_axis (a:: AbstractUnitRange , indices:: BlockSlice{<:BlockIndexRange{1}} )
221- return sub_axis (a, indices. block)
222- end
223-
224- function sub_axis (a:: AbstractUnitRange , indices:: BlockIndices )
225- return sub_axis (a, indices. blocks)
226- end
227-
228- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
229- # Outputs a `BlockUnitRange`.
230- function sub_axis (a:: AbstractUnitRange , indices:: Block )
231- return only (axes (blockedunitrange_getindices (a, indices)))
232- end
233-
234- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
235- # Outputs a `BlockUnitRange`.
236- function sub_axis (a:: AbstractUnitRange , indices:: BlockIndexRange )
237- return only (axes (blockedunitrange_getindices (a, indices)))
238- end
239-
240- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
241- # Outputs a `BlockUnitRange`.
242- function sub_axis (a:: AbstractUnitRange , indices:: AbstractVector{<:Block} )
243- return blockedrange ([length (a[index]) for index in indices])
244- end
245-
246- # TODO : Use `GradedUnitRanges.blockedunitrange_getindices`.
247- # TODO : Merge blocks.
248- function sub_axis (a:: AbstractUnitRange , indices:: BlockVector{<:Block} )
249- # `collect` is needed here, otherwise a `PseudoBlockVector` is
250- # constructed.
251- return blockedrange ([length (a[index]) for index in collect (indices)])
252- end
253-
254195# TODO : Use `Tuple` conversion once
255196# BlockArrays.jl PR is merged.
256197block_to_cartesianindex (b:: Block ) = CartesianIndex (b. n)
0 commit comments