18 main (
int argc,
char *argv[])
29 typedef double scalar_type;
39 const int myRank = mpiSession.
getRank();
41 std::ostream& out = (myRank == 0) ? std::cout : blackHole;
44 std::string robustnessLevel (
"None");
45 bool testBlockGivens =
false;
46 bool testGivensRotations =
false;
49 int testProblemSize = 10;
52 CommandLineProcessor cmdp (
false,
true);
53 cmdp.setOption (
"robustness", &robustnessLevel,
54 "Robustness level: \"None\", \"Some\", or \"Lots\".");
55 cmdp.setOption (
"testGivensRotations",
"dontTestGivensRotations",
57 "Test the implementation of Givens rotations.");
58 cmdp.setOption (
"testBlockGivens",
"dontTestBlockGivens", &testBlockGivens,
59 "Test the panel version of the Givens rotations - based "
61 cmdp.setOption (
"verbose",
"quiet", &verbose,
"Print messages and results.");
62 cmdp.setOption (
"debug",
"release", &debug,
"Print copious debug output.");
63 cmdp.setOption (
"testProblemSize", &testProblemSize,
64 "Number of columns in the projected least-squares test "
66 if (cmdp.parse (argc,argv) != CommandLineProcessor::PARSE_SUCCESSFUL) {
67 out <<
"End Result: TEST FAILED" << endl;
72 std::ostream& verboseOut = verbose ? out : blackHole;
76 verboseOut <<
"-- Robustness level: " << robustnessLevel << endl;
83 ProjectedLeastSquaresSolver<scalar_type> solver (out, robustness);
85 if (testGivensRotations) {
86 solver.testGivensRotations (verboseOut);
88 if (testProblemSize > 0) {
89 const bool extraVerbose = debug;
91 solver.testUpdateColumn (verboseOut, testProblemSize,
92 testBlockGivens, extraVerbose);
94 solver.testTriangularSolves (verboseOut, testProblemSize,
95 robustness, extraVerbose);
99 out <<
"End Result: TEST PASSED" << endl;
102 out <<
"End Result: TEST FAILED" << endl;
int main(int argc, char *argv[])
std::string robustnessEnumToString(const ERobustness x)
Convert the given ERobustness enum value to a string.
ERobustness robustnessStringToEnum(const std::string &x)
Convert the given robustness string value to an ERobustness enum.
Methods for solving GMRES' projected least-squares problem.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
ERobustness
Robustness level of projected least-squares solver operations.
Methods for solving GMRES' projected least-squares problem.