mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add assert for edge case if Thin U Requested at runtime
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user