diff --git a/cpp/testMatrix.cpp b/cpp/testMatrix.cpp index 23815bfdf..734b491cd 100644 --- a/cpp/testMatrix.cpp +++ b/cpp/testMatrix.cpp @@ -427,20 +427,22 @@ TEST( matrix, houseHolder ) 00, 10, 0, 0, 0,-10, -1}; // check in-place householder, with v vectors below diagonal - double data1[] = {0011.1803, 0, -2.2361, 0, -8.9443, 0, 2.236, - 000000000, 11.1803, 0, -2.2361, 0, -8.9443, -1.565, - -0.618034, 0, 4.4721, 0, -4.4721, 0, 0, - 000000000,-0.618034, 0, 4.4721, 0, -4.4721, 0.894}; + double data1[] = { + 11.1803, 0, -2.2361, 0, -8.9443, 0, 2.236, + 0, 11.1803, 0, -2.2361, 0, -8.9443, -1.565, + -0.618034, 0, 4.4721, 0, -4.4721, 0, 0, + 0, -0.618034, 0, 4.4721, 0, -4.4721, 0.894 }; Matrix expected1 = Matrix_(4,7, data1); Matrix A1 = Matrix_(4, 7, data); householder_(A1,3); CHECK(assert_equal(expected1, A1, 1e-3)); // in-place, with zeros below diagonal - double data2[] = {0011.1803, 0, -2.2361, 0, -8.9443, 0, 2.236, - 000000000, 11.1803, 0, -2.2361, 0, -8.9443, -1.565, - 000000000, 0, 4.4721, 0, -4.4721, 0, 0, - 000000000, 0, 0, 4.4721, 0, -4.4721, 0.894}; + double data2[] = { + 11.1803, 0, -2.2361, 0, -8.9443, 0, 2.236, + 0, 11.1803, 0, -2.2361, 0, -8.9443, -1.565, + 0, 0, 4.4721, 0, -4.4721, 0, 0, + 0, 0, 0, 4.4721, 0, -4.4721, 0.894 }; Matrix expected = Matrix_(4,7, data2); Matrix A2 = Matrix_(4, 7, data); householder(A2,3); @@ -619,7 +621,7 @@ TEST( matrix, square_root_positive ) Matrix actual = square_root_positive(cov); CHECK(assert_equal(expected, actual)); - CHECK(assert_equal(cov, trans(actual)*actual)); + CHECK(assert_equal(cov, prod(trans(actual),actual))); }