typename Cholesky<Matrix>::DMatrix Cholesky<Matrix>::doSolve( const AbstractMatrix& b ) { if ( this->rowNum() != b.rows() ) { std::cerr<<"The order of matrix is "<<this->rowNum()<<" and the dimension of vector is "<<b.rows()<<std::endl; throw COException("Cholesky solving error: the size if not consistent!"); } DMatrix result(b); copt_lapack_potrs('U',this->rowNum(),b.cols(),__a,this->lda(),result.dataPtr(),result.lda(),&__info); if ( __info != 0 ) std::cerr<<"Warning in Cholesky solver: solving is wrong!"<<std::endl; return result; }
void operator()(AbstractMatrix<M>& m) const { for (int i=0; i<m.rows(); ++i) for (int j=0; j<m.cols(); ++j) m(i,j) = rand() * a - b; }