Пример #1
0
 SpdMatrix::SpdMatrix(const SubMatrix &rhs, bool check)
 {
   if(check){
     if(rhs.nrow() != rhs.ncol()){
       report_error("SpdMatrix constructor was supplied a non-square"
                    "SubMatrix argument");
     }
   }
   operator=(rhs);
 }
void LMAT::add_to(SubMatrix block)const {
    if(block.nrow() != 3 || block.ncol() !=3) {
        report_error("block is the wrong size in LMAT::add_to");
    }
    double phi = phi_->value();
    block(0,0) += 1;
    block(0,1) += 1;
    block(1,1) += phi;
    block(1,2) += 1-phi;
    block(2,2) += 1;
}