Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion error in introductory-tutorials/intro-to-julia 12. Factorizations and other fun exercise #69

Closed
ShaoxiongYao opened this issue Aug 26, 2020 · 1 comment

Comments

@ShaoxiongYao
Copy link

ShaoxiongYao commented Aug 26, 2020

I am using Julia version 1.5.0
In exercise 11.2, when I run
@assert A_eigv == [-128.49322764802145, -55.887784553056875, 42.7521672793189, 87.16111477514521, 542.4677301466143]

is true. But when I run the solution of exercise
eigdec = eigen(A)
eigdec.values
A_diag = Diagonal(eigdec.values)
@assert A_diag == [-128.493 0.0 0.0 0.0 0.0; 0.0 -55.8878 0.0 0.0 0.0; 0.0 0.0 42.7522 0.0 0.0; 0.0 0.0 0.0 87.1611 0.0; 0.0 0.0 0.0 0.0 542.468]
ther output is
AssertionError: A_diag == [-128.493 0.0 0.0 0.0 0.0; 0.0 -55.8878 0.0 0.0 0.0; 0.0 0.0 42.7522 0.0 0.0; 0.0 0.0 0.0 87.1611 0.0; 0.0 0.0 0.0 0.0 542.468] Stacktrace: [1] top-level scope at In[141]:1 [2] include_string(::Function, ::Module, ::String, ::String) at ./loading.jl:1091
I think the implementation is correct but want to confirm.
I am thinking if we need to increase the accuracy of the result or use other numbers.

@jonas-eschle
Copy link
Contributor

Duplicate of #84, fixed in #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants