47 #include "Epetra_ConfigDefs.h" 
   52 int main(
int argc, 
char* argv[])
 
   56   MPI_Init(&argc, &argv);
 
   65     out = Teuchos::VerboseObjectBase::getDefaultOStream();
 
   73     std::string                             matrixFile             = 
"";
 
   75 #ifdef HAVE_AMESOS_KLU 
   81     bool                                    testTranspose          = 
true;
 
   82     int                                     numRandomVectors       = 1;
 
   83     double                                  maxFwdError            = 1e-14;
 
   84     double                                  maxError               = 1e-10;
 
   85     double                                  maxResid               = 1e-10;
 
   89     CommandLineProcessor  clp;
 
   90     clp.throwExceptions(
false);
 
   91     clp.addOutputSetupOptions(
true);
 
   92     clp.setOption( 
"matrix-file", &matrixFile, 
"Matrix iput file [Required]." );
 
   94       "solver-type", &solverType
 
   96       ,
"Type of direct solver." 
   99       "refactorization-policy", &refactorizationPolicy
 
  101       ,
"Pivoting policy used on refactorizations." 
  103     clp.setOption( 
"test-transpose", 
"no-test-transpose", &testTranspose, 
"Test the transpose solve or not." );
 
  104     clp.setOption( 
"num-random-vectors", &numRandomVectors, 
"Number of times a test is performed with different random vectors." );
 
  105     clp.setOption( 
"max-fwd-error", &maxFwdError, 
"The maximum relative error in the forward operator." );
 
  106     clp.setOption( 
"max-error", &maxError, 
"The maximum relative error in the solution." );
 
  107     clp.setOption( 
"max-resid", &maxResid, 
"The maximum relative error in the residual." );
 
  108     clp.setOption( 
"verbose", 
"quiet", &verbose, 
"Set if output is printed or not." );
 
  109     clp.setOption( 
"show-all-tests", 
"no-show-all-tests", &showAllTests, 
"Set if all the tests are shown or not." );
 
  110     clp.setOption( 
"dump-all", 
"no-dump-all", &dumpAll, 
"Determines if vectors are printed or not." );
 
  111     CommandLineProcessor::EParseCommandLineReturn parse_return = clp.parse(argc,argv);
 
  112     if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL ) 
return parse_return;
 
  117     amesosLOWSFPL.
set(
"Solver Type",
toString(solverType));
 
  118     amesosLOWSFPL.
set(
"Refactorization Policy",
toString(refactorizationPolicy));
 
  121       = Thyra::test_single_amesos_thyra_solver(
 
  122         matrixFile,&amesosLOWSFPL,testTranspose,numRandomVectors
 
  123         ,maxFwdError,maxError,maxResid,showAllTests,dumpAll,verbose?&*out:0
 
  127   catch( 
const std::exception &excpt ) {
 
  128     std::cerr << 
"*** Caught standard exception : " << excpt.what() << std::endl;
 
  132     std::cerr << 
"*** Caught an unknown exception\n";
 
  137     if(success)  *out << 
"\nCongratulations! All of the tests checked out!\n";
 
  138     else         *out << 
"\nOh no! At least one of the tests failed!\n";
 
  145   return ( success ? 0 : 1 );
 
ERefactorizationPolicy
The policy used on refactoring a matrix. 
 
int main(int argc, char *argv[])
 
const std::string toString(const EAdjointEpetraOp adjointEpetraOp)
 
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
 
const ERefactorizationPolicy refactorizationPolicyValues[numRefactorizationPolices]
 
const int numRefactorizationPolices
 
const char * solverTypeNames[numSolverTypes]
 
const char * refactorizationPolicyNames[numRefactorizationPolices]
 
const ESolverType solverTypeValues[numSolverTypes]
 
Completely new pivoting will be used on refactorizations! 
 
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)