We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec7dcb6 commit e0732e7Copy full SHA for e0732e7
stdlib/LinearAlgebra/src/bidiag.jl
@@ -166,10 +166,11 @@ end
166
end
167
168
@inline function getindex(A::Bidiagonal{T}, b::BandIndex) where T
169
- @boundscheck checkbounds(A, _cartinds(b))
+ @boundscheck checkbounds(A, b)
170
if b.band == 0
171
return @inbounds A.dv[b.index]
172
- elseif b.band == _offdiagind(A.uplo)
+ elseif b.band ∈ (-1,1) && b.band == _offdiagind(A.uplo)
173
+ # we explicitly compare the possible bands as b.band may be constant-propagated
174
return @inbounds A.ev[b.index]
175
else
176
return bidiagzero(A, Tuple(_cartinds(b))...)
0 commit comments