mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +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().
This commit is contained in:
parent
478a1bdda6
commit
4284c68fbb
@ -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