Multiplication test: fix division resulting in NAN

This commit is contained in:
Matthias Grob 2019-09-17 07:41:49 +02:00 committed by Julian Kent
parent 3747232724
commit b0b7d7229a

View File

@ -27,7 +27,17 @@ int main()
Matrix3f C_check = eye<float, 3>()*2;
TEST(isEqual(B, B_check));
Matrix3f C = B_check.edivide(C_check);
TEST(isEqual(C, C_check));
// off diagonal are NANs because division by 0
for (size_t i = 0; i < 3; i++) {
for (size_t j = 0; j < 3; j++) {
if (i == j) {
TEST(isEqualF(C(i,j), 2.f));
} else {
TEST(isnan(C(i,j)));
}
}
}
// Test non-square matrix
float data_43[12] = {1,3,2,