Amesos Package Browser (Single Doxygen Collection) Development
SparseSolverResult.cpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //                Amesos: Direct Sparse Solver Package
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #include "SparseSolverResult.h"
00030 #include <iomanip>
00031 
00032 void SparseSolverResult::Print(std::ostream & os) const {
00033   if ( error != UnUsedDbl ) { os << "error=" << error << " " ; }
00034   if ( residual != UnUsedDbl ) { os << "residual=" << residual << std::endl ; }
00035   if ( Anorm != UnUsedDbl ) { os << "Anorm=" << Anorm << " " ; }
00036   if ( Bnorm != UnUsedDbl ) { os << "Bnorm=" << Bnorm << std::endl ; }
00037   if ( Xnorm != UnUsedDbl ) { os << "Xnorm=" << Xnorm << std::endl ; }
00038 
00039 }
00040 
00041 void SparseSolverResult::PrintSummary(std::ostream & os) const {
00042   os << std::setw(9) << std::setprecision(2) << Anorm ; 
00043   if ( error != UnUsedDbl && Xnorm != UnUsedDbl ) 
00044     { os << std::setw(9) << std::setprecision(2) << error/Xnorm << " " ; } else os << " error is unknown " ; 
00045   if ( residual != UnUsedDbl && Bnorm != UnUsedDbl ) 
00046     { os << std::setw(9) << std::setprecision(2) << residual/Bnorm << " " ; } else os << " residual is unknown " ; 
00047   os << std::setw(10) << std::setprecision(4) << total_time  ; 
00048 #if 0
00049   double TotalWallClock = 0.0 ; 
00050   if ( RedistribTime_.WallTime() != UnUsedDbl )
00051     { TotalWallClock += RedistribTime_.WallTime() ; } ; 
00052   if ( SymbolicTime_.WallTime() != UnUsedDbl )
00053     { TotalWallClock += SymbolicTime_.WallTime() ; } ; 
00054   if ( FactorTime_.WallTime() != UnUsedDbl )
00055     { TotalWallClock += FactorTime_.WallTime() ; } ; 
00056   if ( SolveTime_.WallTime() != UnUsedDbl )
00057     { TotalWallClock += SolveTime_.WallTime() ; } ; 
00058   os << std::setw(10) << std::setprecision(4) << TotalWallClock  ; 
00059 #endif
00060   if ( first_time != UnUsedDbl ) 
00061     os << std::setw(10) << std::setprecision(4) << first_time  ; 
00062   else
00063     os << "        na " ; 
00064   if ( middle_time != UnUsedDbl ) 
00065     os << std::setw(10) << std::setprecision(4) << last_time - middle_time ; 
00066   else
00067     os << "        na " ; 
00068   if ( last_time != UnUsedDbl ) 
00069     os << std::setw(10) << std::setprecision(4) << last_time - first_time ; 
00070   else
00071     os << "        na " ; 
00072 
00073 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines