Skip to content

Commit 8f2c309

Browse files
committed
correct output types
1 parent 17b004c commit 8f2c309

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/implementations/eig.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ function check_input(::typeof(eig_full!), A::AbstractMatrix, DV, ::DiagonalAlgor
3232
m, n = size(A)
3333
@assert m == n && isdiag(A)
3434
D, V = DV
35-
@assert D isa Diagonal && V isa Diagonal
35+
@assert D isa Diagonal
3636
@check_size(D, (m, m))
3737
@check_size(V, (m, m))
3838
# Diagonal doesn't need to promote to complex scalartype since we know it is diagonalizable
3939
@check_scalar(D, A)
40-
@check_scalar(V, A)
40+
@check_scalar(V, A, real)
4141
return nothing
4242
end
4343
function check_input(::typeof(eig_vals!), A::AbstractMatrix, D, ::DiagonalAlgorithm)
@@ -70,7 +70,7 @@ function initialize_output(::Union{typeof(eig_trunc!), typeof(eig_trunc_no_error
7070
end
7171

7272
function initialize_output(::typeof(eig_full!), A::Diagonal, ::DiagonalAlgorithm)
73-
return A, similar(A)
73+
return A, similar(A, real(eltype(A)), size(A))
7474
end
7575
function initialize_output(::typeof(eig_vals!), A::Diagonal, ::DiagonalAlgorithm)
7676
return diagview(A)

0 commit comments

Comments
 (0)