CloudCompare / CloudCompare

CloudCompare main repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

function Jacobi ComputeEigenValuesAndVectors calculate problem

YuBoTao123 opened this issue · comments

Describe the bug

eigen vector and eigen value differ from calculation by eigen lib 3.4.0?

Your environment

  • CC Version (or git hash/tag): v2.13.alpha
  • OS & Version: linux64 bit
  • Graphics card:
  • Qt Version (if compiling):

image
image

Interesting (and concerning). And which one is the closest to the truth?

I think eigen lib.
Tow solution have same eigen values, but the first eigen vector is not same.(I have set absoluteValues parameter to false in ComputeEigenValuesAndVectors function, although this matrix eigen value is Positive value)

So I looked at this again, and actually I misread your results. The only difference is the sign of the first eigenvector isn't it?

As the definition of an eigenvector and eigenvalue is that M(X) = lambda.X, X or -X are both acceptable (as M(-X) = -lambda.X).

It took me some time to realize that it was the only difference between your 2 results. For the records, I used https://github.com/jewettaij/jacobi_pd/tree/master and https://matrixcalc.org/vectors.html to double check everything.

Yes, the difference is the sign of the first eigenvector. But why two first eigen value is same?

Well, all eigenvalues are the same.

I should have written the equation above:
M(-X) = lambda.(-X)

The eigenvector can be flipped, it won't change the eigenvalue sign.

I guess the only thing we could do is to make sure that the 3 eigenvectors form a direct orthonormal basis (E3 = E1 ^ E2). But that's not a requirement per se, and we don't use eigenvectors this way in CloudCompare anyway.

I think I figured it out .Thanks for your patient answer!