Skip to content

Commit bec6120

Browse files
committed
Char uplo in Bidiagonal constructor
1 parent f0e36ea commit bec6120

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/bidiag.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ julia> Bl = Bidiagonal(dv, ev, :L) # ev is on the first subdiagonal
6565
⋅ ⋅ 9 4
6666
```
6767
"""
68-
function Bidiagonal(dv::V, ev::V, uplo::Symbol) where {T,V<:AbstractVector{T}}
69-
Bidiagonal{T,V}(dv, ev, uplo)
70-
end
71-
function Bidiagonal(dv::V, ev::V, uplo::AbstractChar) where {T,V<:AbstractVector{T}}
68+
function Bidiagonal(dv::V, ev::V, uplo::Union{Symbol, AbstractChar}) where {T,V<:AbstractVector{T}}
7269
Bidiagonal{T,V}(dv, ev, uplo)
7370
end
7471

7572
#To allow Bidiagonal's where the "dv" is Vector{T} and "ev" Vector{S},
7673
#where T and S can be promoted
77-
function Bidiagonal(dv::Vector{T}, ev::Vector{S}, uplo::Symbol) where {T,S}
74+
function Bidiagonal(dv::Vector{T}, ev::Vector{S}, uplo::Union{Symbol, AbstractChar}) where {T,S}
7875
TS = promote_type(T,S)
7976
return Bidiagonal{TS,Vector{TS}}(dv, ev, uplo)
8077
end

test/bidiag.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ Random.seed!(1)
512512
@test Matrix{ComplexF64}(BD) == BD
513513
end
514514

515+
@testset "Constructors with Char uplo"
516+
@test Bidiagonal(Int8[1,2], [1], 'U') == Bidiagonal(Int8[1,2], [1], :U)
517+
end
518+
515519
# Issue 10742 and similar
516520
let A = Bidiagonal([1,2,3], [0,0], :U)
517521
@test istril(A)

0 commit comments

Comments
 (0)