Skip to content

Commit 64b254b

Browse files
committed
Specialize for Bidiagonal
1 parent e923b03 commit 64b254b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/bidiag.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ Bidiagonal(A::Bidiagonal) = A
115115
Bidiagonal{T}(A::Bidiagonal{T}) where {T} = A
116116
Bidiagonal{T}(A::Bidiagonal) where {T} = Bidiagonal{T}(A.dv, A.ev, A.uplo)
117117

118+
"""
119+
LinearAlgebra.uplo(S::Bidiagonal)::Symbol
120+
121+
Return a `Symbol` corresponding to whether the upper or lower off-diagonal band is stored.
122+
"""
123+
uplo(::Bidiagonal) = sym_uplo(B.uplo)
124+
118125
_offdiagind(uplo) = uplo == 'U' ? 1 : -1
119126

120127
@inline function Base.isassigned(A::Bidiagonal, i::Int, j::Int)

test/bidiag.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Random.seed!(1)
4747
# from vectors
4848
ubd = Bidiagonal(x, y, :U)
4949
lbd = Bidiagonal(x, y, :L)
50+
@test LinearAlgebra.uplo(ubd) == :U
51+
@test LinearAlgebra.uplo(lbd) == :L
5052
@test ubd != lbd || x === dv0
5153
@test ubd.dv === x
5254
@test lbd.ev === y

0 commit comments

Comments
 (0)