mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
nestbyvalue test: fix uninitialized matrix
- Doing computation with uninitialized (zero-ed ? but thanks Linux) matrix, or
worse NaN on other non-linux systems.
- This commit fixes it by initializing to Random().
(cherry picked from commit 4284c68fbb)
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
6f57470bcc
commit
c379a21191
@@ -26,7 +26,7 @@ EIGEN_DECLARE_TEST(nestbyvalue)
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
Index rows = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
|
||||
Index cols = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
|
||||
MatrixXd a = MatrixXd(rows,cols);
|
||||
MatrixXd a = MatrixXd::Random(rows,cols);
|
||||
nb_temporaries = 0;
|
||||
XprType x = get_xpr_with_temps(a);
|
||||
VERIFY_IS_EQUAL(nb_temporaries,6);
|
||||
|
||||
Reference in New Issue
Block a user