Skip to content

Commit 91b8845

Browse files
authored
Use BandIndex directly in diagzero call in getindex (#1222)
We use `to_indices` in `diagzero`, which should take care of the conversion. This would simplify the code in the `diagzero` calls.
2 parents ef7ef3a + af7a9ac commit 91b8845

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/bidiag.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ end
161161
# we explicitly compare the possible bands as b.band may be constant-propagated
162162
return @inbounds A.ev[b.index]
163163
else
164-
return diagzero(A, Tuple(_cartinds(b))...)
164+
return diagzero(A, b)
165165
end
166166
end
167167

src/diagonal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ zeroslike(::Type{M}, sz::Tuple{Integer, Vararg{Integer}}) where {M<:AbstractMatr
213213
if b.band == 0
214214
@inbounds r = D.diag[b.index]
215215
else
216-
r = diagzero(D, Tuple(_cartinds(b))...)
216+
r = diagzero(D, b)
217217
end
218218
r
219219
end

0 commit comments

Comments
 (0)