I need to compute the Singular Value Decomposition (SVD) of many $4 \times 4$ matrices. I'm looking for SVD algorithms specialized for small matrices. I've read that the std::vector
sorting algorithm in the C++ STL is often hardcoded for short vectors for optimal performance. I want to hard code the SVD for the case $4 \times 4$ matrices.
What information is there about optimally solving small cases of SVD?
Eigen::JacobiSVD<Matrix<float, 4, 4>, Eigen::NoQRPreconditioner>
would be optimal for your problem, as no preconditioner is required for square matrices. eigen.tuxfamily.org/dox/classEigen_1_1JacobiSVD.html $\endgroup$ – Charlie S Sep 10 '20 at 12:52