Closed prashantmital closed 9 years ago
It is a bit more complicated because it depends on the signs of the diagonal values. I think I fixed this now (see 420a0cc and tests introduced in d37eabd). Do you agree?
@tjhei Yes, your edits make more sense than my simplistic suggestion. However, I am not familiar with this unittest framework in C++ is this taken from Boost? Working with Python has made me quite used to unittests so I must thank you for informing me that C++ has some similar support.
Closing #2
No this is https://github.com/philsquared/Catch
For the case of zero off-diagonal terms consider the following matrix:
The current setup will recognize
e1=5
,e2=0
and populate the eigenvectors as:Thus making
(0,1)
the eigenvector associated with the eigenvalue5
. In reality, this should be the other way around. A simple swap fixes it.