mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-08 14:11:49 +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 4284c68fbb81cb069a630ae1bf4a953ee922f6e5)
This commit is contained in:
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user