kwcall ambiguity for lu(Symmetric(BandedMatrix))

Offen
#243 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
julia
Bereich
tooling

Rechercherichtung

Reproduziere die Mehrdeutigkeit mit dem Julia- und BandedMatrices-Beispiel im Issue und untersuche anschließend src/factorizations.jl um die Zeilen 314 und 427-429 zusammen mit den in der Stacktrace gezeigten LinearAlgebra-Methoden aus lu.jl. Erledigt ist dies, wenn lu(Symmetric(A)) keine kwcall-Mehrdeutigkeit mehr auslöst und das bestehende Verhalten von lu(A) weiterhin gültig ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

julia> using BandedMatrices, LinearAlgebra

julia> A = brand(10, 10, 2, 2);

julia> lu(A) # seems fine
BandedMatrices.BandedLU{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}
L factor:
10×10 Matrix{Float64}:
  1.0          0.0           0.0           0.0          …   0.0           0.0          0.0        0.0       0.0
  0.130262     1.0           0.0           0.0              0.0           0.0          0.0        0.0       0.0
  0.628091     0.925623      1.0           0.0              0.0           0.0          0.0        0.0       0.0
  6.56551e-17  4.66203e-16  -0.930112      1.0              0.0           0.0          0.0        0.0       0.0
  9.48947e-17  5.10714e-16   1.70639e-16  -1.66186e-16      0.0           0.0          0.0        0.0       0.0
  1.09378e-16  4.08892e-16   2.02321e-16  -1.53524e-16  …   1.0           0.0          0.0        0.0       0.0
 -1.48462e-17  3.74493e-16   3.01977e-17  -4.18909e-17      9.42525e-17   1.0          0.0        0.0       0.0
  2.69952e-17  3.59865e-16   1.39717e-16  -3.46407e-16     -1.07228e-16   1.46833e-16  1.0        0.0       0.0
 -2.07649e-16  1.52132e-16  -2.19689e-16   0.506627         0.014214      0.34169      0.447224   1.0       0.0
  5.26367e-17  0.19874      -0.121982      0.26927         -0.108379     -0.76199      0.820067  -0.405123  1.0
U factor:
10×10 BandedMatrix{Float64} with bandwidths (2, 4):
 0.958321  0.64343    0.0950425  0.0        0.0         ⋅         ⋅          ⋅          ⋅          ⋅
 0.0       0.605374   0.924089   0.18638    0.976283   0.0        ⋅          ⋅          ⋅          ⋅
 0.0       0.0       -0.800624   0.233672  -0.903669   0.0       0.0         ⋅          ⋅          ⋅
  ⋅        0.0        0.0        0.535959   0.0770822  0.474611  0.370779   0.0         ⋅          ⋅
  ⋅         ⋅         0.0        0.0        0.843502   0.38096   0.934787   0.113725   0.571547    ⋅
  ⋅         ⋅          ⋅         0.0        0.0        0.82845   0.0961225  0.264537   0.542442   0.620033
  ⋅         ⋅          ⋅          ⋅         0.0        0.0       0.481825   0.520846   0.993578   0.448423
  ⋅         ⋅          ⋅          ⋅          ⋅         0.0       0.0        0.47772    0.384355   0.59676
  ⋅         ⋅          ⋅          ⋅          ⋅          ⋅        0.0        0.0       -0.816749  -0.42892
  ⋅         ⋅          ⋅          ⋅          ⋅          ⋅         ⋅         0.0        0.0       -0.254256

julia> lu(Symmetric(A))
MethodError: kwcall(::@NamedTuple{check::Bool}, ::typeof(lu!), ::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, ::RowMaximum) is ambiguous.

Candidates:
  kwcall(::NamedTuple, ::typeof(lu!), A::AbstractMatrix, pivot::Union{NoPivot, RowMaximum, RowNonZero})
    @ LinearAlgebra C:\Users\danjv\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\lu.jl:132
  kwcall(::NamedTuple, ::typeof(lu!), A::Union{Hermitian{var"#s6993", var"#s6994"}, Hermitian{Complex{var"#s6993"}, var"#s6994"}, Symmetric{var"#s6993", var"#s6994"}} where {var"#s6993"<:Real, var"#s6994"<:(ArrayLayouts.LayoutMatrix)}, args...)
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:429
  kwcall(::NamedTuple, ::typeof(lu!), A::Union{Hermitian{T, S}, Symmetric{T, S}} where S, pivot::Union{NoPivot, RowMaximum, RowNonZero}) where T
    @ LinearAlgebra C:\Users\danjv\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\lu.jl:86

Possible fix, define
  kwcall(::NamedTuple, ::typeof(lu!), ::Union{Hermitian{var"#s6993", var"#s6994"}, Hermitian{Complex{var"#s6993"}, var"#s6994"}, Symmetric{var"#s6993", var"#s6994"}} where {var"#s6993"<:Real, var"#s6994"<:(ArrayLayouts.LayoutMatrix)}, ::Union{NoPivot, RowMaximum, RowNonZero})

Stacktrace:
  [1] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, pivot::RowMaximum; check::Bool)
    @ LinearAlgebra C:\Users\danjv\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\lu.jl:300
  [2] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, pivot::RowMaximum)
    @ LinearAlgebra C:\Users\danjv\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\lu.jl:299
  [3] lu_layout(layout::ArrayLayouts.SymmetricLayout{BandedMatrices.BandedColumns{ArrayLayouts.DenseColumnMajor}}, axes::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, pivot::RowMaximum; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:315
  [4] lu_layout(layout::ArrayLayouts.SymmetricLayout{BandedMatrices.BandedColumns{ArrayLayouts.DenseColumnMajor}}, axes::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, pivot::RowMaximum)
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:315
  [5] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}, pivot::RowMaximum; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:427
  [6] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}})
    @ LinearAlgebra C:\Users\danjv\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\lu.jl:299
  [7] lu_layout(layout::ArrayLayouts.SymmetricLayout{BandedMatrices.BandedColumns{ArrayLayouts.DenseColumnMajor}}, axes::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:314
  [8] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}}; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:428
  [9] lu(A::Symmetric{Float64, BandedMatrix{Float64, Matrix{Float64}, Base.OneTo{Int64}}})
    @ ArrayLayouts C:\Users\danjv\.julia\packages\ArrayLayouts\31idh\src\factorizations.jl:428
 [10] top-level scope
    @ REPL[7]:1
Vorherrschende Sprache
Julia
Sterne
57
Forks
10
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus JuliaLinearAlgebra/ArrayLayouts.jl

Alle Issues in JuliaLinearAlgebra/ArrayLayouts.jl

Ähnliche Issues

Weitere Issues zu Julia

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.