packages/Alea/mc_solvers/GmresPolynomial.cc
//---------------------------------------------------------------------------//
// Build GMRES coefficients from Arnoldi decomposition
//---------------------------------------------------------------------------//
Build GMRES coefficients from Arnoldi decomposition
Build GMRES coefficients from Arnoldi decomposition
void GmresPolynomial::buildGmresPolyFromArnoldi()
{
    using std::chrono::high_resolution_clock;
    using std::chrono::duration_cast;
    using std::chrono::milliseconds;
    high_resolution_clock::time_point time_start = high_resolution_clock::now();
    if( b_verbosity >= LOW )
        std::cout << "Creating GMRES polynomial coefficients"
            << " of order " << b_m << " from Arnoldi process" << std::endl;
    Teuchos::RCP<Teuchos::SerialDenseMatrix<LO,SCALAR> > arnoldi_mat =
        computeArnoldiMatrix(b_m+1);
    CHECK( arnoldi_mat != Teuchos::null );
    Teuchos::ArrayRCP<const Anasazi::Value<SCALAR> > gmres_roots =
        computeGmresRoots(arnoldi_mat);
    CHECK( gmres_roots.size() == b_m+1 );
    b_coeffs = computeCoeffsFromRoots(gmres_roots);
    high_resolution_clock::time_point time_end = high_resolution_clock::now();
    if( b_verbosity >= HIGH )
    {
        std::cout << "GMRES root calculation took "
            << duration_cast<milliseconds>(time_end-time_start).count()
            << " milliseconds" << std::endl;
    }
}
void GmresPolynomial :: buildGmresPolyFromArnoldi ( ) { using std :: chrono :: high_resolution_clock ; using std :: chrono :: duration_cast ; using std :: chrono :: milliseconds ; high_resolution_clock :: time_point time_start = high_resolution_clock :: now ( ) ; if ( b_verbosity >= LOW ) std :: cout << " " << " " << b_m << " " << std :: endl ; Teuchos :: RCP < Teuchos :: SerialDenseMatrix < LO , SCALAR > > arnoldi_mat = computeArnoldiMatrix ( b_m + 1 ) ; CHECK ( arnoldi_mat != Teuchos :: null ) ; Teuchos :: ArrayRCP < const Anasazi :: Value < SCALAR > > gmres_roots = computeGmresRoots ( arnoldi_mat ) ; CHECK ( gmres_roots . size ( ) == b_m + 1 ) ; b_coeffs = computeCoeffsFromRoots ( gmres_roots ) ; high_resolution_clock :: time_point time_end = high_resolution_clock :: now ( ) ; if ( b_verbosity >= HIGH ) { std :: cout << " " << duration_cast < milliseconds > ( time_end - time_start ) . count ( ) << " " << std :: endl ; } }
Build GMRES coefficients from Arnoldi decomposition
Build GMRES coefficients from Arnoldi decomposition