50 main (
int argc,
char *argv[])
61 typedef double scalar_type;
71 const int myRank = mpiSession.
getRank();
73 std::ostream& out = (myRank == 0) ? std::cout : blackHole;
76 std::string robustnessLevel (
"None");
77 bool testBlockGivens =
false;
78 bool testGivensRotations =
false;
81 int testProblemSize = 10;
84 CommandLineProcessor cmdp (
false,
true);
85 cmdp.setOption (
"robustness", &robustnessLevel,
86 "Robustness level: \"None\", \"Some\", or \"Lots\".");
87 cmdp.setOption (
"testGivensRotations",
"dontTestGivensRotations",
89 "Test the implementation of Givens rotations.");
90 cmdp.setOption (
"testBlockGivens",
"dontTestBlockGivens", &testBlockGivens,
91 "Test the panel version of the Givens rotations - based "
93 cmdp.setOption (
"verbose",
"quiet", &verbose,
"Print messages and results.");
94 cmdp.setOption (
"debug",
"release", &debug,
"Print copious debug output.");
95 cmdp.setOption (
"testProblemSize", &testProblemSize,
96 "Number of columns in the projected least-squares test "
98 if (cmdp.parse (argc,argv) != CommandLineProcessor::PARSE_SUCCESSFUL) {
99 out <<
"End Result: TEST FAILED" << endl;
104 std::ostream& verboseOut = verbose ? out : blackHole;
108 verboseOut <<
"-- Robustness level: " << robustnessLevel << endl;
115 ProjectedLeastSquaresSolver<scalar_type> solver (out, robustness);
117 if (testGivensRotations) {
118 solver.testGivensRotations (verboseOut);
120 if (testProblemSize > 0) {
121 const bool extraVerbose = debug;
123 solver.testUpdateColumn (verboseOut, testProblemSize,
124 testBlockGivens, extraVerbose);
126 solver.testTriangularSolves (verboseOut, testProblemSize,
127 robustness, extraVerbose);
131 out <<
"End Result: TEST PASSED" << endl;
134 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.