-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Description
Consider the following MWE:
using LinearAlgebra, SparseArrays
n = 10
A = sprand(n, n, 1/n)
A = A + A' + 10I
B = rand(n, 2)
Bt = Matrix(B')
F = factorize(A')
F \ B # works just fine
F \ Bt' # breaksERROR: MethodError: no method matching ldiv!(::LinearAlgebra.AdjointFactorization{Float64, SparseArrays.CHOLMOD.Factor{Float64, Int64}}, ::Matrix{Float64})
Closest candidates are:
ldiv!(::BunchKaufman{T, <:StridedMatrix{T} where T}, ::StridedVecOrMat{T}) where T<:Union{Float32, Float64}
@ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/bunchkaufman.jl:329
ldiv!(::LinearAlgebra.QRCompactWY{T, M, C} where {M<:AbstractMatrix{T}, C<:AbstractMatrix{T}}, ::AbstractMatrix{T}) where T
@ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/qr.jl:523
ldiv!(::UpperHessenberg, ::AbstractVecOrMat; shift)
@ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/hessenberg.jl:179
...
Stacktrace:
[1] \(F::LinearAlgebra.AdjointFactorization{Float64, SparseArrays.CHOLMOD.Factor{Float64, Int64}}, B::Adjoint{Float64, Matrix{Float64}})
@ LinearAlgebra ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/factorization.jl:143
[2] top-level scope
@ REPL[27]:1
[3] top-level scope
@ none:1
A similar situation happens in one of my codes that implements the Sherman-Morrison-Woodbury formula. What is the proper way to fix this?
- Define
adjoint(F::SparseArrays.CHOLMOD.Factor) = F? - Make
Adjoint{T, Matrix{T}}aStridedMatrix? - Define the missing method of
ldiv!? - ...?
Option 1 would work, but seems out of place given this method of (\) (permalink created from release-1.10). I didn't test options 2 or 3. What would be the best option to have this work with the current LTS?
Metadata
Metadata
Assignees
Labels
No labels