core.matrix icon indicating copy to clipboard operation
core.matrix copied to clipboard

eigen decomposition not yet implemented?

Open michaellindon opened this issue 9 years ago • 7 comments

I'm trying to perform an eigen decomposition of a simple matrix

(eigen [[10 2] [2 10]])

I get an error

ExceptionInfo TODO: Not yet implemented: (mp/eigen m options) for class mikera.matrixx.Matrix clojure.core/ex-info (core.clj:4617)

is this really the case? How else can I get the eigen decomposition of a matrix.

michaellindon avatar Nov 02 '16 02:11 michaellindon

Use an implementation that has eigendecomposition implemented.

(set-current-implementation :vectorz) should work if you use the Vectorz implementation. I think Clatrix works too.

mikera avatar Nov 06 '16 10:11 mikera

I was using :vectorz implementation when this error message was produced.

michaellindon avatar Nov 06 '16 18:11 michaellindon

Ah sorry I see that Eigendecomposition is not fully implemented yet for vectorz. There are complexities around the handling of complex numbers.... do you need compex eigenvalues?

mikera avatar Nov 07 '16 01:11 mikera

I'd be more than happy with just real eigenvalues implemented for now :) That's all I need for my purposes

michaellindon avatar Nov 08 '16 01:11 michaellindon

bump

I too would like eigendecomposition for real matrices. It looks like clatrix is abandoned.

Or, is there a better supported core.matrix implementation you'd recommend switching to?

drone29a avatar Sep 30 '18 20:09 drone29a

Ah, and I see the issue with the Vectorz backend is that the library itself doesn't yet provide eigendecomposition. Was hoping it was as easy as uncommenting out the wrapper code in vectorz-clj.

drone29a avatar Oct 01 '18 02:10 drone29a

eigen is still not working

An alternative is to use svd from clojure.core.matrix.linear One can transform the results from svd to eigendecomposition

Or, using clatrix will be fine too.

daniel-yj-yang avatar Sep 10 '20 04:09 daniel-yj-yang