@@ -118,13 +118,6 @@ Bidiagonal(A::Bidiagonal) = A
118118Bidiagonal {T} (A:: Bidiagonal{T} ) where {T} = A
119119Bidiagonal {T} (A:: Bidiagonal ) where {T} = Bidiagonal {T} (A. dv, A. ev, A. uplo)
120120
121- function convert (:: Type{T} , A:: AbstractMatrix ) where T<: Bidiagonal
122- checksquare (A)
123- isbanded (A, - 1 , 1 ) || throw (InexactError (:convert , T, A))
124- iszero (diagview (A, 1 )) ? T (A, :L ) :
125- iszero (diagview (A, - 1 )) ? T (A, :U ) : throw (InexactError (:convert , T, A))
126- end
127-
128121_offdiagind (uplo) = uplo == ' U' ? 1 : - 1
129122
130123@inline function Base. isassigned (A:: Bidiagonal , i:: Int , j:: Int )
@@ -227,7 +220,12 @@ promote_rule(::Type{<:Tridiagonal}, ::Type{<:Bidiagonal}) = Tridiagonal
227220AbstractMatrix {T} (A:: Bidiagonal ) where {T} = Bidiagonal {T} (A)
228221AbstractMatrix {T} (A:: Bidiagonal{T} ) where {T} = copy (A)
229222
230- convert (:: Type{T} , m:: AbstractMatrix ) where {T<: Bidiagonal } = m isa T ? m : T (m):: T
223+ function convert (:: Type{T} , A:: AbstractMatrix ) where T<: Bidiagonal
224+ checksquare (A)
225+ isbanded (A, - 1 , 1 ) || throw (InexactError (:convert , T, A))
226+ iszero (diagview (A, 1 )) ? T (A, :L ) :
227+ iszero (diagview (A, - 1 )) ? T (A, :U ) : throw (InexactError (:convert , T, A))
228+ end
231229
232230similar (B:: Bidiagonal , :: Type{T} ) where {T} = Bidiagonal (similar (B. dv, T), similar (B. ev, T), B. uplo)
233231similar (B:: Bidiagonal , :: Type{T} , dims:: Union{Dims{1},Dims{2}} ) where {T} = similar (B. dv, T, dims)
0 commit comments