Skip to content
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

Merged
merged 1 commit into from
Jul 10, 2017

Conversation

fredrikekre
Copy link
Member

@fredrikekre fredrikekre commented Jul 7, 2017

  • 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

@fredrikekre fredrikekre force-pushed the fe/bidiag-constr branch 4 times, most recently from b1c0a33 to d0deabd Compare July 7, 2017 10:35
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
Copy link
Member

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"?

@fredrikekre
Copy link
Member Author

AV is the libgit2 failure.

@fredrikekre
Copy link
Member Author

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
@andreasnoack andreasnoack merged commit ff781e5 into JuliaLang:master Jul 10, 2017
@fredrikekre fredrikekre deleted the fe/bidiag-constr branch July 10, 2017 18:16
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."))
Copy link
Member Author

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

jeffwong pushed a commit to jeffwong/julia that referenced this pull request Jul 24, 2017
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants