Skip to content

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Dec 3, 2023

Close JuliaLang/LinearAlgebra.jl#1042, or at least the part that may be addressed here. After this, the first axis for an Adjoint(parent::AbstractVector) will be the second axis of the parent. This will change the type of the axis where the parent array type specializes axes(A, d). In the short term, this would improve type-stability in cases such as

julia> A = OffsetArray([1,2], 2);

julia> @code_typed axes(A')[1]
CodeInfo(
1%1 = $(Expr(:boundscheck))::Bool%2 = Base.getfield(t, i, %1)::OffsetArrays.IdOffsetRange{Int64, Base.OneTo{Int64}}
└──      return %2
) => OffsetArrays.IdOffsetRange{Int64, Base.OneTo{Int64}}

where the result is now concretely inferred instead of being a small Union.
In principle, with JuliaArrays/StaticArrays.jl#916, this would make the axes of the adjoint of a StaticVector statically sized.

@jishnub jishnub added the linear algebra Linear algebra label Dec 3, 2023
Copy link
Member

@dkarrasch dkarrasch left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@dkarrasch dkarrasch added the merge me PR is reviewed. Merge when all tests are passing label Dec 5, 2023
@N5N3 N5N3 merged commit d0e7ec0 into master Dec 5, 2023
@N5N3 N5N3 deleted the jishnub/adjaxes branch December 5, 2023 14:54
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axes for transposed OffsetArray vector incorrect due to LinearAlgebra method

4 participants