1

I have a really large sparse matrix encoded in Eigen in C++ and I need the exact condition number.

Eigen does not have functionality for this.

Someone I know said I should export the matrix and read it with matlab, except I don;t have a matlab license and I would not know how to export it.

I am thinking of using octave or julia instead. All I really need is the condition number somehow with the minimum amount of custom code possible.

Makogan
  • 8,208
  • 7
  • 44
  • 112
  • You might want to check your wording. The wording "condition matrix" does not strike me as a correct description of what you are after. In any event, eigen *does* provide facilities to compute eigenvalues of a matrix. And the condition number is the ratio of the magnitudes of the largest-magnitude and smallest-magnitude eigenvalues. Also your wording using "exact" is not possible - the best you can do is gain a result as accurate as possible within limits of numeric precision. – Peter Sep 29 '22 at 03:27
  • I wanted to say condition number, I miss typed. – Makogan Sep 29 '22 at 03:28
  • @Peter the API for sparse matrices is different than for dense matrices, I cannot find a way to get the singular values of a sparse amtrix. – Makogan Sep 29 '22 at 03:29
  • Look up the amadillo or spectra libraries. – Peter Sep 29 '22 at 03:31
  • Duplicate, see [here](https://stackoverflow.com/q/30188482/3740047). – Sedenion Sep 29 '22 at 05:33
  • 1
    Does this answer your question? [Sparse eigenvalues using eigen3/sparse](https://stackoverflow.com/questions/30188482/sparse-eigenvalues-using-eigen3-sparse) – florestan Sep 29 '22 at 06:09
  • It doesn;t I tried it and spectra takes hours to find the solution. I need to do what I described, export the data into a file on disk and load it into a dedicated software for it, matlab is too annoying so octave is probabbly the best candidate, I just don;t know what format to export the data into – Makogan Sep 30 '22 at 23:40

0 Answers0