mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix bug in minmax_coeff_visitor for matrix of all NaNs.
This commit is contained in:
@@ -92,8 +92,27 @@ template<typename MatrixType> void matrixVisitor(const MatrixType& p)
|
||||
VERIFY(maxrow != eigen_maxrow || maxcol != eigen_maxcol);
|
||||
VERIFY((numext::isnan)(eigen_minc));
|
||||
VERIFY((numext::isnan)(eigen_maxc));
|
||||
}
|
||||
|
||||
// Test matrix of all NaNs.
|
||||
m.fill(NumTraits<Scalar>::quiet_NaN());
|
||||
eigen_minc = m.template minCoeff<PropagateNumbers>(&eigen_minrow, &eigen_mincol);
|
||||
eigen_maxc = m.template maxCoeff<PropagateNumbers>(&eigen_maxrow, &eigen_maxcol);
|
||||
VERIFY(eigen_minrow == 0);
|
||||
VERIFY(eigen_maxrow == 0);
|
||||
VERIFY(eigen_mincol == 0);
|
||||
VERIFY(eigen_maxcol == 0);
|
||||
VERIFY((numext::isnan)(eigen_minc));
|
||||
VERIFY((numext::isnan)(eigen_maxc));
|
||||
|
||||
eigen_minc = m.template minCoeff<PropagateNaN>(&eigen_minrow, &eigen_mincol);
|
||||
eigen_maxc = m.template maxCoeff<PropagateNaN>(&eigen_maxrow, &eigen_maxcol);
|
||||
VERIFY(eigen_minrow == 0);
|
||||
VERIFY(eigen_maxrow == 0);
|
||||
VERIFY(eigen_mincol == 0);
|
||||
VERIFY(eigen_maxcol == 0);
|
||||
VERIFY((numext::isnan)(eigen_minc));
|
||||
VERIFY((numext::isnan)(eigen_maxc));
|
||||
}
|
||||
}
|
||||
|
||||
template<typename VectorType> void vectorVisitor(const VectorType& w)
|
||||
|
||||
Reference in New Issue
Block a user