Changeset 453

Show
Ignore:
Timestamp:
07/30/09 09:22:50 (15 years ago)
Author:
vbarta
Message:

moved square_mat children's tests to testsuite

Location:
library/tests
Files:
4 removed
2 modified

Legend:

Unmodified
Added
Removed
  • library/tests/CMakeLists.txt

    r448 r453  
    1010target_link_libraries(testutil bdm itpp unittest) 
    1111 
    12 EXEC(chmat_test) 
    13 EXEC(ldmat_test) 
    14  
    1512add_executable(square_mat_stress square_mat_stress.cpp) 
    1613target_link_libraries(square_mat_stress bdm itpp testutil unittest) 
    1714 
    18 EXEC(fsqmat_test) 
    1915EXEC(emix_test) 
    20 EXEC(test0) 
    2116EXEC(testResample) 
    2217 
  • library/tests/square_mat_test.cpp

    r438 r453  
    2626 
    2727template<typename TMatrix> 
    28 void test_square_matrix_minimum(double epsilon) { 
     28void test_square_matrix(double epsilon) { 
    2929    int sz = 3; 
    3030    mat A0 = randu(sz, sz); 
    3131    mat A = A0 * A0.T(); 
    32  
     32         
    3333    TMatrix sqmat(A); 
    3434    CHECK_EQUAL(sz, sqmat.rows()); 
     
    6161    CHECK_CLOSE(r, q, epsilon); 
    6262 
     63    q = sqmat.invqform(v); 
     64    r = (invA * v) * v; 
     65    CHECK_CLOSE(r, q, epsilon); 
     66 
    6367    sqmat2 = sqmat; 
    6468    sqmat2.clear(); 
    6569    CHECK_EQUAL(0, sqmat2.qform(ones(sz))); 
    66 } 
    6770 
    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); 
    7771    TMatrix twice = sqmat; 
    7872    twice += sqmat; 
    79     mat res(2 * A); 
     73    res = 2 * A; 
    8074    CHECK_CLOSE(res, twice.to_mat(), epsilon); 
    8175 
     
    8478    CHECK_CLOSE(res, twice.to_mat(), epsilon); 
    8579 
    86     TMatrix sqmat2 = sqmat; 
     80    sqmat2 = sqmat; 
    8781    mat B = randu(sz, sz); 
    8882    sqmat2.mult_sym(B);