-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
once more unto the decomposition breach, dear friends! #27212
Conversation
792170c
to
6927882
Compare
To my surprise and delight, I was able to finish everything this evening except for the gentler |
Feel free to cherry pick from https://github.com/JuliaLang/julia/commits/breakmore |
@@ -1,4 +1,4 @@ | |||
# This file is a part of Julia. License is MIT: https://julialang.org/license | |||
# This file is a part of Julia. License is MIT: https://julialang.org/license |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Should be fixed :).
@@ -7,6 +7,7 @@ using Base: @deprecate, depwarn | |||
@deprecate cond(F::LinearAlgebra.LU, p::Integer) cond(convert(AbstractArray, F), p) | |||
|
|||
# PR #22188 | |||
export cholfact, cholfact! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @deprecate
macro does the exporting for you by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed so :). I had forgotten at first, and once I remembered halfway through I decided to proceed consistently. Please feel welcome to remove the explicit exports!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a major concern by any means — just thought I'd mention it as I was reviewing.
# deprecate eig(...) in favor of eigfact and factorization destructuring | ||
export eig | ||
function eig(A::Union{Number, StridedMatrix}; permute::Bool=true, scale::Bool=true) | ||
depwarn(string("`eig(A[, permute, scale])` has been deprecated in favor of ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this eig(A[, permute, scale])
notation a little confusing — maybe just literally `eig(A; ...)`
?
end | ||
|
||
# deprecate transitional decomposition getindex methods out of the blocks | ||
@inline function Base.getindex(S::LU, i::Integer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and below) cannot be inlined for the deprecation to work. depwarn
needs to have a stack frame to do its warn-once tracking.
Hessenberg(A::StridedMatrix) = Hessenberg(LAPACK.gehrd!(A)...) | ||
|
||
# iteration for destructuring into components | ||
Base.iterate(S::Hessenberg) = (S.Q, Val(:H)) | ||
Base.iterate(S::Hessenberg, ::Val{:H}) = (S.H, Val(:done)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the others) is quite clever. I'm still catching up with all the things the new optimizer can do, but this seems like it'll be out of its reach and add quite a bit of dynamic dispatch. Maybe just:
+Base.iterate(S::Hessenberg) = (S.Q, false)
+Base.iterate(S::Hessenberg, isdone) = isdone ? nothing : (S.H, true)
Or for the bigger factorizations, this might have a better chance of piggy-backing on the inference magic for tuples (it doesn't quite get it right now, though):
@inline function Base.iterate(x::S, state=nothing)
tup = (x.a, x.b, x.c)
state===nothing ? iterate(tup) : iterate(tup, state)
end
(Much thanks @fredrikekre and @mbauman! :D) |
Incorporated Matt's Had a brief look at one of Fred's commits: I am not certain that Out of time now, hope to find bits of time again in a couple of hours. Thanks all and best! |
It should be possible to deprecate |
Maybe not, but we should only have to keep the legacy_chol method for
and then we don't need
|
Failures are related to Pkg3 being renamed and/or timeouts. |
I very much like the new factorization interface and all the work that has been done here. Congrats to everbody involved. I do have one question. I tried to look for a discussion about the name change |
There are still no docs for |
once more unto the decomposition breach, dear friends!
...or close up the wall with our obscure initialisms!
This pull request is take three on the recent decompositions rework; take two was #27159, and take one was #26997.
Specifically, this pull request deprecates
lufact[!]
,schurfact[!]
,lqfact[!]
,qrfact[!]
,ldltfact[!]
, andsvdfact[!]
tolu[!]
,schur[!]
,lq[!]
,qr[!]
,ldlt[!]
, andsvd[!]
respectively, clobbering existing methods of the latter functions.Additionally, this pull request (will eventually) deprecate
eig
/eigfact[!]
toeigen[!]
,chol[!]
/cholfact[!]
tocholesky[!]
,bkfact[!]
tobunchkaufman[!]
, andhessfact[!]
tohessenberg[!]
.To facilitate this deprecation, this pull request adds destructuring via iteration to some of the decomposition objects, and (immediately deprecated)
getindex(S::($DecompositionType), i::Integer)
methods that yield the decomposition components produced by iteration.Pending items:
bkfact[!]
tobunchkaufman[!]
hessfact[!]
tohessenberg[!]
eigfact[!]
toeigen[!]
cholfact[!]
tocholesky[!]
eig
toeigen
chol[!]
tocholesky[!]
getindex
methodsBest!