Update SVD Module to allow specifying computation options with a template parameter. Resolves #2051

This commit is contained in:
Arthur
2021-11-29 20:50:46 +00:00
committed by Rasmus Munk Larsen
parent 4a76880351
commit eef33946b7
23 changed files with 766 additions and 636 deletions

View File

@@ -211,7 +211,7 @@ MatrixType randomRotationMatrix()
// https://www.isprs-ann-photogramm-remote-sens-spatial-inf-sci.net/III-7/103/2016/isprs-annals-III-7-103-2016.pdf
const MatrixType rand = MatrixType::Random();
const MatrixType q = rand.householderQr().householderQ();
const JacobiSVD<MatrixType> svd = q.jacobiSvd(ComputeFullU | ComputeFullV);
const JacobiSVD<MatrixType, ComputeFullU | ComputeFullV> svd(q);
const typename MatrixType::Scalar det = (svd.matrixU() * svd.matrixV().transpose()).determinant();
MatrixType diag = rand.Identity();
diag(MatrixType::RowsAtCompileTime - 1, MatrixType::ColsAtCompileTime - 1) = det;