Changeset 453
- Timestamp:
- 07/30/09 09:22:50 (15 years ago)
- Location:
- library/tests
- Files:
-
- 4 removed
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/CMakeLists.txt
r448 r453 10 10 target_link_libraries(testutil bdm itpp unittest) 11 11 12 EXEC(chmat_test)13 EXEC(ldmat_test)14 15 12 add_executable(square_mat_stress square_mat_stress.cpp) 16 13 target_link_libraries(square_mat_stress bdm itpp testutil unittest) 17 14 18 EXEC(fsqmat_test)19 15 EXEC(emix_test) 20 EXEC(test0)21 16 EXEC(testResample) 22 17 -
library/tests/square_mat_test.cpp
r438 r453 26 26 27 27 template<typename TMatrix> 28 void test_square_matrix _minimum(double epsilon) {28 void test_square_matrix(double epsilon) { 29 29 int sz = 3; 30 30 mat A0 = randu(sz, sz); 31 31 mat A = A0 * A0.T(); 32 32 33 33 TMatrix sqmat(A); 34 34 CHECK_EQUAL(sz, sqmat.rows()); … … 61 61 CHECK_CLOSE(r, q, epsilon); 62 62 63 q = sqmat.invqform(v); 64 r = (invA * v) * v; 65 CHECK_CLOSE(r, q, epsilon); 66 63 67 sqmat2 = sqmat; 64 68 sqmat2.clear(); 65 69 CHECK_EQUAL(0, sqmat2.qform(ones(sz))); 66 }67 70 68 template<typename TMatrix>69 void test_square_matrix(double epsilon) {70 test_square_matrix_minimum<TMatrix>(epsilon);71 72 int sz = 3;73 mat A0 = randu(sz, sz);74 mat A = A0 * A0.T();75 76 TMatrix sqmat(A);77 71 TMatrix twice = sqmat; 78 72 twice += sqmat; 79 mat res(2 * A);73 res = 2 * A; 80 74 CHECK_CLOSE(res, twice.to_mat(), epsilon); 81 75 … … 84 78 CHECK_CLOSE(res, twice.to_mat(), epsilon); 85 79 86 TMatrixsqmat2 = sqmat;80 sqmat2 = sqmat; 87 81 mat B = randu(sz, sz); 88 82 sqmat2.mult_sym(B);