Fix compilation error in JacobiSVD with HouseholderQRPreconditioner and row-vector input
Reference issue
This MR is related to #1387 (closed) and #1395 (closed). The compilation error discussed was resolved for the FullPiv and ColPiv QR preconditioners, but (for some reason), the same problem still exists for the HouseholderQRPreconditioner in master!
What does this implement/fix?
For compile-time row vector inputs, JacobiSVD has a compilation error when using the HouseholderQRPreconditioner. The implementation used when there are more columns than rows has a "TransposeWithSameStorageOrder" type that causes the compilation error, since compile-time vectors need their storage order to be properly set.
There's two small changes:
- This MR essentially applies the same fix that was used for the other two preconditioners.
- It also makes a small update to the jacobisvd test so that it can catch this compilation error.
I'm sure this is an extremely rare use-case, but SVD is still well-defined in this case and I think it's better for the preconditioners have consistent behavior.
Here is an example that will cause the compilation error:
#include <iostream>
#include <Eigen/Core>
#include <Eigen/SVD>
using namespace Eigen;
int main() {
const int options = ComputeFullU | ComputeFullV;
RowVector3d rv {1, 2, 3};
JacobiSVD<RowVector3d, HouseholderQRPreconditioner> house_rowvec_svd(rv, options); // COMPILATION ERROR!
std::cout << house_rowvec_svd.singularValues().transpose() << '\n';
}