jbrown1618 / vector

A linear algebra library for TypeScript and JavaScript
MIT License
13 stars 1 forks source link

Does not calculate eigenvalues for singular matrices #129

Closed khayyam90 closed 3 years ago

khayyam90 commented 3 years ago

Hi,

It's me again, still with the eigen vector calculation. I have another case ending with an error :

let m = mat([
        [2,-1,-1],
        [-1,2,-1],
        [-1,-1,2]
        ]);
        let e = eig(m);

Uncaught Error: A is singular; no QR decomposition exists but the eigen values do exist : 3,3,0

jbrown1618 commented 3 years ago

That is helpful - I'm using the QR algorithm to find the eigenvalues, but my implementation chokes on singular matrices.

jbrown1618 commented 3 years ago

The right solution is, I think, to fix my QR algorithm implementation (rather than try a different method when it fails). The QR factorization exists for singular matrices (but the result is not unique).

jbrown1618 commented 3 years ago

It might be necessary to use an algorithm other than Graham-Schmidt for the QR decomposition.

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 4.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: