-
-
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
Use Symbol for uplo in Bidiagonal constructors #22703
Conversation
b1c0a33
to
d0deabd
Compare
NEWS.md
Outdated
@@ -136,6 +136,9 @@ Deprecated or removed | |||
* The method `replace(s::AbstractString, pat, r, count)` with `count <= 0` is deprecated | |||
in favor of `replace(s::AbstractString, pat, r, typemax(Int))` ([#22325]). | |||
|
|||
* `Bidiagonal` constructors have been re-factored to use a `Symbol` for the upper/lower |
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.
"have been re-factored to" -> "now"?
d0deabd
to
42d19c4
Compare
AV is the libgit2 failure. |
42d19c4
to
7f9d324
Compare
Rebased. |
- Consistent with Symmetric/Hermitian wrappers - It is clearer to use :U/:L instead of true/false - The Char constructor was originally for internal use only; remove and remove docstring
7f9d324
to
cc96e65
Compare
Bidiagonal(dv::AbstractVector{T}, ev::AbstractVector{T}, isupper::Bool) where {T} = Bidiagonal{T}(collect(dv), collect(ev), isupper) | ||
function Bidiagonal(dv::AbstractVector{T}, ev::AbstractVector{T}, uplo::Symbol) where T | ||
Bidiagonal{T}(collect(dv), collect(ev), char_uplo(uplo)) | ||
end | ||
Bidiagonal(dv::AbstractVector, ev::AbstractVector) = throw(ArgumentError("did you want an upper or lower Bidiagonal? Try again with an additional true (upper) or false (lower) argument.")) |
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.
Woops, missed to update this one. Can we just remove this method? IMO a MethodError
is better:
julia> Bidiagonal(a, b)
ERROR: MethodError: no method matching Bidiagonal(::Array{Float64,1}, ::Array{Float64,1})
Closest candidates are:
Bidiagonal(::Array{T,1}, ::Array{T,1}, ::Char) where T at linalg/bidiag.jl:15
Bidiagonal(::AbstractArray{T,1}, ::AbstractArray{T,1}, ::Symbol) where T at linalg/bidiag.jl:59
Bidiagonal(::AbstractArray{Td,1}, ::AbstractArray{Te,1}, ::Symbol) where {Td, Te} at linalg/bidiag.jl:64
- Consistent with Symmetric/Hermitian wrappers - It is clearer to use :U/:L instead of true/false - The Char constructor was originally for internal use only; remove and remove docstring
Symmetric
/Hermitian
wrappers:U
/:L
instead oftrue
/false
Char
constructor was originally for internal use only; remove and remove docstring