diff --git a/src/bidiag.jl b/src/bidiag.jl index 2e323f6f..2c0714e7 100644 --- a/src/bidiag.jl +++ b/src/bidiag.jl @@ -65,16 +65,13 @@ julia> Bl = Bidiagonal(dv, ev, :L) # ev is on the first subdiagonal ⋅ ⋅ 9 4 ``` """ -function Bidiagonal(dv::V, ev::V, uplo::Symbol) where {T,V<:AbstractVector{T}} - Bidiagonal{T,V}(dv, ev, uplo) -end -function Bidiagonal(dv::V, ev::V, uplo::AbstractChar) where {T,V<:AbstractVector{T}} +function Bidiagonal(dv::V, ev::V, uplo::Union{Symbol, AbstractChar}) where {T,V<:AbstractVector{T}} Bidiagonal{T,V}(dv, ev, uplo) end #To allow Bidiagonal's where the "dv" is Vector{T} and "ev" Vector{S}, #where T and S can be promoted -function Bidiagonal(dv::Vector{T}, ev::Vector{S}, uplo::Symbol) where {T,S} +function Bidiagonal(dv::Vector{T}, ev::Vector{S}, uplo::Union{Symbol, AbstractChar}) where {T,S} TS = promote_type(T,S) return Bidiagonal{TS,Vector{TS}}(dv, ev, uplo) end diff --git a/test/bidiag.jl b/test/bidiag.jl index 3abf2cb5..c5ed26e1 100644 --- a/test/bidiag.jl +++ b/test/bidiag.jl @@ -512,6 +512,10 @@ Random.seed!(1) @test Matrix{ComplexF64}(BD) == BD end +@testset "Constructors with Char uplo" begin + @test Bidiagonal(Int8[1,2], [1], 'U') == Bidiagonal(Int8[1,2], [1], :U) +end + # Issue 10742 and similar let A = Bidiagonal([1,2,3], [0,0], :U) @test istril(A)