Skip to content

Commit

Permalink
Rename eigenvalues and eigenvectors in show method for Eigen
Browse files Browse the repository at this point in the history
…and `GeneralizedEigen` (JuliaLang#33393)

Signed-off-by: Alexander Seiler <[email protected]>
  • Loading branch information
goggle authored and StefanKarpinski committed Sep 26, 2019
1 parent 9a1dbc0 commit 36f34af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions stdlib/LinearAlgebra/src/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Iterating the decomposition produces the components `F.values` and `F.vectors`.
```jldoctest
julia> F = eigen([1.0 0.0 0.0; 0.0 3.0 0.0; 0.0 0.0 18.0])
Eigen{Float64,Float64,Array{Float64,2},Array{Float64,1}}
eigenvalues:
values:
3-element Array{Float64,1}:
1.0
3.0
18.0
eigenvectors:
vectors:
3×3 Array{Float64,2}:
1.0 0.0 0.0
0.0 1.0 0.0
Expand Down Expand Up @@ -84,11 +84,11 @@ julia> B = [0 1; 1 0]
julia> F = eigen(A, B)
GeneralizedEigen{Complex{Float64},Complex{Float64},Array{Complex{Float64},2},Array{Complex{Float64},1}}
eigenvalues:
values:
2-element Array{Complex{Float64},1}:
0.0 - 1.0im
0.0 + 1.0im
eigenvectors:
vectors:
2×2 Array{Complex{Float64},2}:
0.0+1.0im 0.0-1.0im
-1.0+0.0im -1.0-0.0im
Expand Down Expand Up @@ -202,12 +202,12 @@ accept a `sortby` keyword.
```jldoctest
julia> F = eigen([1.0 0.0 0.0; 0.0 3.0 0.0; 0.0 0.0 18.0])
Eigen{Float64,Float64,Array{Float64,2},Array{Float64,1}}
eigenvalues:
values:
3-element Array{Float64,1}:
1.0
3.0
18.0
eigenvectors:
vectors:
3×3 Array{Float64,2}:
1.0 0.0 0.0
0.0 1.0 0.0
Expand Down Expand Up @@ -608,9 +608,9 @@ eigvecs(A::AbstractMatrix, B::AbstractMatrix; kws...) = eigvecs(eigen(A, B; kws.

function show(io::IO, mime::MIME{Symbol("text/plain")}, F::Union{Eigen,GeneralizedEigen})
summary(io, F); println(io)
println(io, "eigenvalues:")
println(io, "values:")
show(io, mime, F.values)
println(io, "\neigenvectors:")
println(io, "\nvectors:")
show(io, mime, F.vectors)
end

Expand Down
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/test/eigen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ end
valsstring = sprint((t, s) -> show(t, "text/plain", s), e.values)
vecsstring = sprint((t, s) -> show(t, "text/plain", s), e.vectors)
factstring = sprint((t, s) -> show(t, "text/plain", s), e)
@test factstring == "$(summary(e))\neigenvalues:\n$valsstring\neigenvectors:\n$vecsstring"
@test factstring == "$(summary(e))\nvalues:\n$valsstring\nvectors:\n$vecsstring"
end

@testset "eigen of an Adjoint" begin
Expand Down

0 comments on commit 36f34af

Please sign in to comment.