mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix a bunch of warnings (actual issues) reported by Frank
This commit is contained in:
@@ -34,7 +34,7 @@ template<typename MatrixType> void matrixSum(const MatrixType& m)
|
||||
MatrixType m1 = MatrixType::Random(rows, cols);
|
||||
|
||||
VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::Zero(rows, cols).sum(), Scalar(1));
|
||||
VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(rows*cols));
|
||||
VERIFY_IS_APPROX(MatrixType::Ones(rows, cols).sum(), Scalar(float(rows*cols))); // the float() here to shut up excessive MSVC warning about int->complex conversion being lossy
|
||||
Scalar x = Scalar(0);
|
||||
for(int i = 0; i < rows; i++) for(int j = 0; j < cols; j++) x += m1(i,j);
|
||||
VERIFY_IS_APPROX(m1.sum(), x);
|
||||
|
||||
Reference in New Issue
Block a user