Skip to content

Conversation

tkf
Copy link
Member

@tkf tkf commented Nov 13, 2019

Their getindex are defined in terms of multiplications. So I guess it makes sense to mark them as non-fast_scalar_indexing?

function getindex(Q::AbstractQ, i::Integer, j::Integer)
    x = zeros(eltype(Q), size(Q, 1))
    x[i] = 1
    y = zeros(eltype(Q), size(Q, 2))
    y[j] = 1
    return dot(x, lmul!(Q, y))
end

--- https://github.com/JuliaLang/julia/blob/6eebbbe2d205f8116330a77ca5e15f4a356232db/stdlib/LinearAlgebra/src/qr.jl#L526-L532

getindex(A::LQPackedQ, i::Integer, j::Integer) =
    lmul!(A, setindex!(zeros(eltype(A), size(A, 2)), 1, j))[i]

--- https://github.com/JuliaLang/julia/blob/6eebbbe2d205f8116330a77ca5e15f4a356232db/stdlib/LinearAlgebra/src/lq.jl#L139-L140

@ChrisRackauckas ChrisRackauckas merged commit 88bbbfb into JuliaArrays:master Nov 13, 2019
@ChrisRackauckas
Copy link
Member

Yes, good point!

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.

2 participants