Changeset 455

Show
Ignore:
Timestamp:
07/30/09 16:44:28 (15 years ago)
Author:
smidl
Message:

test mult_sym_t(.,.)

Location:
library
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/math/chmat.cpp

    r437 r455  
    1717mat chmat::to_mat() const {mat F=Ch.T() *Ch;return F;}; 
    1818void chmat::mult_sym ( const mat &C ) { 
    19         it_assert_debug(C.cols()==dim, "Wrong dimension of U"); 
     19        it_assert_debug(C.rows()==dim, "Wrong dimension of U"); 
    2020        if(!qr(Ch*C.T(), Ch)) {it_warning("QR unstable in chmat mult_sym");} 
    2121}; 
    2222void chmat::mult_sym ( const mat &C , chmat &U ) const { 
    23         it_assert_debug(C.cols()==U.dim, "Wrong dimension of U"); 
     23        it_assert_debug(C.rows()==U.dim, "Wrong dimension of U"); 
    2424        if(!qr(Ch*C.T(), U.Ch)) {it_warning("QR unstable in chmat mult_sym");} 
    2525}; 
    2626void chmat::mult_sym_t ( const mat &C ) { 
    27         it_assert_debug(C.rows()==dim, "Wrong dimension of U"); 
     27        it_assert_debug(C.cols()==dim, "Wrong dimension of U"); 
    2828        if(!qr(Ch*C, Ch)) {it_warning("QR unstable in chmat mult_sym");} 
    2929}; 
    3030void chmat::mult_sym_t ( const mat &C, chmat &U ) const { 
    31         it_assert_debug(C.rows()==U.dim, "Wrong dimension of U"); 
     31        it_assert_debug(C.cols()==U.dim, "Wrong dimension of U"); 
    3232        if(!qr(Ch*C, U.Ch)) {it_warning("QR unstable in chmat mult_sym");} 
    3333}; 
  • library/tests/square_mat_test.cpp

    r453 r455  
    8484    CHECK_CLOSE(res, sqmat2.to_mat(), epsilon); 
    8585 
     86    mat C = randu(sz, sz-1); 
     87         TMatrix CAC(sz-1); 
     88    sqmat.mult_sym_t(C,CAC); 
     89    res = (C.T() * A) * C; 
     90    CHECK_CLOSE(res, CAC.to_mat(), epsilon); 
     91 
    8692    sqmat2 = sqmat; 
    8793    sqmat2.mult_sym_t(B);