3
$\begingroup$

I have a function whose main bottleneck is finding a(ny) singular vector pair in the space of the largest singular value, along with the singular value itself. This is done a huge number of times. This is the structure I know about:

  • Tiny. 4x4 is the most common case, but anything less than 100x100 could be possible
  • Dense and complex
  • Square
  • Largest singular value bounded by square root of width

Right now we are using Eigen::JacobiSVD. Would anyone recommend something faster? The final iterations of the function require lots of precision, but we may be able to get away with less precision in the beginning iterations.

$\endgroup$
4
  • 1
    $\begingroup$ Just a check, do you connect Eigen to some high-performance BLAS/LAPACK library? Say Intel MKL. $\endgroup$
    – Anton Menshov
    Commented Nov 19, 2019 at 16:45
  • $\begingroup$ I am constrained by a distribution scheme that makes this a bit tricky, but I can look into it. $\endgroup$
    – Ian Hincks
    Commented Nov 19, 2019 at 17:45
  • $\begingroup$ Since you only want the largest pair, have you tried an iterative method, such as the power/Krylov iterations? Note that if you have access to an eigenvalue solver you can probably apply it to A^TA with impunity, as the numerical issues should not affect the largest SV pair. $\endgroup$ Commented Nov 21, 2019 at 12:01
  • $\begingroup$ I'm going to try a few methods. I was just trying to figure out if there was some obvious choice to make. $\endgroup$
    – Ian Hincks
    Commented Nov 21, 2019 at 14:30

1 Answer 1

3
$\begingroup$

According to the documentation, Eigen::BDCSVD outperforms Eigen::JacobiSVD for sizes n >= 16, though testing is warranted and simple enough. The interface is exactly the same.

https://eigen.tuxfamily.org/dox/classEigen_1_1BDCSVD.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.