Skip to content

Conversation

@lkdvos
Copy link
Contributor

@lkdvos lkdvos commented Nov 18, 2025

This is a large WIP of my progress for the GradedArraysNext refactor.
The main problem to simply start merging is that the testsuite needs either updating or marking things as broken, and I don't think I can find the time to get that done before tomorrow, so for now I'll just leave this as is.

Comment on lines +24 to +27
const GradedUnitRange{I, R1, R2} =
BlockUnitRange{Int, Vector{SectorUnitRange{I, R1, R2}}, Vector{Int}, BlockedOneTo{Int, Vector{Int}}}

function Base.similar(
a::AbstractArray, elt::Type, axes::Tuple{SectorOneTo, Vararg{SectorOneTo}}
)
return similar(a, elt, Base.OneTo.(length.(axes)))
end
const GradedOneTo{I} = GradedUnitRange{I, Base.OneTo{Int}, Base.OneTo{Int}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be something like this:

Suggested change
const GradedUnitRange{I, R1, R2} =
BlockUnitRange{Int, Vector{SectorUnitRange{I, R1, R2}}, Vector{Int}, BlockedOneTo{Int, Vector{Int}}}
function Base.similar(
a::AbstractArray, elt::Type, axes::Tuple{SectorOneTo, Vararg{SectorOneTo}}
)
return similar(a, elt, Base.OneTo.(length.(axes)))
end
const GradedOneTo{I} = GradedUnitRange{I, Base.OneTo{Int}, Base.OneTo{Int}}
const GradedUnitRange{I, R1, R2} =
BlockUnitRange{Int, Vector{SectorUnitRange{I, R1, R2}}, Vector{Int}}
const GradedOneTo{I, R1, R2} = BlockOneTo{Int, Vector{SectorUnitRange{I, R1, R2}}, Vector{Int}}

using BlockOneTo.

# @testset "svd_compact (eltype=$elt)" for elt in elts
elt = Float64
for i in [2, 3], j in [2, 3], k in [2, 3], l in [2, 3]
r1 = gradedrange([U1(0) => i, U1(1) => j])
Copy link
Member

@mtfishman mtfishman Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add back gradedrange as a constructor (which would call blockrange internally).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants