We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Bidiagonal
Matrix
1 parent a8fd121 commit 6546108Copy full SHA for 6546108
src/bidiag.jl
@@ -189,10 +189,20 @@ end
189
#Converting from Bidiagonal to dense Matrix
190
function Matrix{T}(A::Bidiagonal) where T
191
B = Matrix{T}(undef, size(A))
192
+ iszero(size(B,1)) && return B
193
if haszero(T) # optimized path for types with zero(T) defined
194
size(B,1) > 1 && fill!(B, zero(T))
- copyto!(diagview(B), A.dv)
195
- copyto!(diagview(B, _offdiagind(A.uplo)), A.ev)
+ isupper = A.uplo == 'U'
196
+ if isupper
197
+ B[1,1] = A.dv[1]
198
+ end
199
+ for col in axes(A.ev,1)
200
+ B[col+!isupper, col+isupper] = A.ev[col]
201
+ B[col+isupper, col+isupper] = A.dv[col+isupper]
202
203
+ if !isupper
204
+ B[end,end] = A.dv[end]
205
206
else
207
copyto!(B, A)
208
end
0 commit comments