Changeset 427 for library/tests

Show
Ignore:
Timestamp:
07/24/09 08:53:22 (15 years ago)
Author:
vbarta
Message:

deriving ldmat publically (like all other children of square_mat); more tests

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/tests/square_mat_test.cpp

    r426 r427  
    3232 
    3333    TMatrix sqmat(A); 
     34    CHECK_EQUAL(sz, sqmat.rows()); 
     35    CHECK_EQUAL(sz, sqmat.cols()); 
     36 
    3437    mat res = sqmat.to_mat(); 
    3538    CHECK_CLOSE(A, res, epsilon); 
     
    4548    double d = det(A); 
    4649    CHECK_CLOSE(log(d), sqmat.logdet(), epsilon); 
     50 
     51    double q = sqmat.qform(ones(sz)); 
     52    CHECK_CLOSE(sumsum(A), q, epsilon); 
     53 
     54    q = sqmat.qform(v); 
     55    double r = (A * v) * v; 
     56    CHECK_CLOSE(r, q, epsilon); 
     57 
     58    sqmat2 = sqmat; 
     59    sqmat2.clear(); 
     60    CHECK_EQUAL(0, sqmat2.qform(ones(sz))); 
    4761} 
    4862