Add assert for edge case if Thin U Requested at runtime

This commit is contained in:
Arthur
2022-02-23 05:35:19 +00:00
committed by Antonio Sánchez
parent 35727928ad
commit cd80e04ab7
4 changed files with 17 additions and 16 deletions

View File

@@ -482,9 +482,9 @@ void svd_compute_checks(const MatrixType& m) {
template <typename SvdType, typename MatrixType>
void svd_check_constructor_options(const MatrixType& m, unsigned int computationOptions) {
const bool thinUnitary = (computationOptions & ComputeThinU) != 0 || (computationOptions & ComputeThinV) != 0;
if (SvdType::ColsAtCompileTime != Dynamic && thinUnitary) {
const bool fixedRowAndThinU = SvdType::RowsAtCompileTime != Dynamic && (computationOptions & ComputeThinU) != 0 && m.cols() < m.rows();
const bool fixedColAndThinV = SvdType::ColsAtCompileTime != Dynamic && (computationOptions & ComputeThinV) != 0 && m.rows() < m.cols();
if (fixedRowAndThinU || fixedColAndThinV) {
VERIFY_RAISES_ASSERT(SvdType svd(m, computationOptions));
return;
}