18 bool RowMapEqualsColMap,
19 bool TestAddZeroToDiag,
22 double &maxrelresidual,
32 bool MyVerbose = false ;
33 std::string StringAmesosClass = AmesosClass ;
34 if ( AmesosClass ) MyVerbose =
verbose ;
38 ParamList.
set(
"NoDestroy",
true );
39 ParamList.
set(
"Redistribute",
true );
40 ParamList.
set(
"AddZeroToDiag",
false );
41 ParamList.
set(
"MaxProcs", 100000 );
47 if (MyVerbose) std::cout << __FILE__ <<
"::" << __LINE__ <<
" AmesosClass= " << AmesosClass
48 <<
" ParamList = " << ParamList
49 <<
" transpose = " << transpose
50 <<
" Levels = " << Levels
63 relresidual, ExpectedError ) ;
65 if (MyVerbose || ( Errors && iam==0 ) ) std::cout << __FILE__ <<
"::" << __LINE__
66 <<
" AmesosClass= " << AmesosClass
67 <<
" Errors = " << Errors
74 std::cout << AmesosClass <<
" failed with error code " << Errors <<
" " << __FILE__ <<
"::" << __LINE__ << std::endl ;
79 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
80 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
84 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
85 if ( MyVerbose && Errors ) {
86 std::cout << AmesosClass <<
" failed with transpose = " <<
87 (transpose?
"true":
"false") << std::endl ;
91 std::string AC = AmesosClass ;
93 bool taucs = ( AC ==
"Amesos_Taucs" );
94 bool klu = ( AC ==
"Amesos_Klu" );
95 bool paraklete = ( AC ==
"Amesos_Paraklete" );
96 bool mumps = ( AC ==
"Amesos_Mumps" );
97 bool scalapack = ( AC ==
"Amesos_Scalapack" ) ;
98 bool lapack = ( AC ==
"Amesos_Lapack" );
114 bool supports_AddToDiag_with_AddZeroToDiag = ( klu || paraklete || scalapack || lapack ) ;
115 bool supports_AddToDiag_with_when_AddZeroTo_Diag_is_false = ( klu || paraklete || mumps || taucs || lapack ) ;
118 if ( RowMapEqualsColMap && supports_AddToDiag_with_AddZeroToDiag && TestAddZeroToDiag ) {
120 ParamList.
set(
"NoDestroy",
true );
121 ParamList.
set(
"Redistribute",
false );
122 ParamList.
set(
"AddZeroToDiag",
true );
123 ParamList.
set(
"AddToDiag", 1.3e2 );
130 if (MyVerbose) std::cout << __FILE__ <<
"::" << __LINE__ <<
" AmesosClass= " << AmesosClass
131 <<
" ParamList = " << ParamList
132 <<
" transpose = " << transpose
133 <<
" Levels = " << Levels
146 relresidual, ExpectedError ) ;
149 if (MyVerbose || ( Errors && iam==0 ) ) std::cout << __FILE__ <<
"::" << __LINE__
150 <<
" AmesosClass= " << AmesosClass
151 <<
" Errors = " << Errors
158 std::cout << __FILE__ <<
"::" << __LINE__
159 << AmesosClass <<
" failed with error code " << Errors <<
" " << __FILE__ <<
"::" << __LINE__ << std::endl ;
162 NumErrors += Errors ;
164 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
165 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
169 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
170 if ( MyVerbose && Errors ) {
171 std::cout << AmesosClass <<
" failed with transpose = " <<
172 (transpose?
"true":
"false") << std::endl ;
178 if ( RowMapEqualsColMap && supports_AddToDiag_with_when_AddZeroTo_Diag_is_false ) {
180 ParamList.
set(
"NoDestroy",
true );
181 ParamList.
set(
"Redistribute",
false );
182 ParamList.
set(
"AddToDiag", 1e2 );
189 if (MyVerbose) std::cout << __FILE__ <<
"::" << __LINE__ <<
" AmesosClass= " << AmesosClass
190 <<
" ParamList = " << ParamList
191 <<
" transpose = " << transpose
192 <<
" Levels = " << Levels
205 relresidual, ExpectedError ) ;
208 if (MyVerbose || ( Errors && iam==0 ) ) std::cout << __FILE__ <<
"::" << __LINE__
209 <<
" AmesosClass= " << AmesosClass
210 <<
" Errors = " << Errors
217 std::cout << __FILE__ <<
"::" << __LINE__
218 << AmesosClass <<
" failed with error code " << Errors <<
" " << __FILE__ <<
"::" << __LINE__ << std::endl ;
221 NumErrors += Errors ;
223 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
224 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
228 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
229 if ( MyVerbose && Errors ) {
230 std::cout << AmesosClass <<
" failed with transpose = " <<
231 (transpose?
"true":
"false") << std::endl ;
242 ParamList.
set(
"NoDestroy",
true );
243 ParamList.
set(
"Refactorize",
true );
248 if (MyVerbose) std::cout << __FILE__ <<
"::" << __LINE__ <<
" AmesosClass= " << AmesosClass
249 <<
" ParamList = " << ParamList
250 <<
" transpose = " << transpose
251 <<
" Levels = " << Levels
264 relresidual, ExpectedError ) ;
266 if (MyVerbose || ( Errors && iam==0 ) ) std::cout << __FILE__ <<
"::" << __LINE__
267 <<
" AmesosClass= " << AmesosClass
268 <<
" Errors = " << Errors
272 if (MyVerbose ) std::cout << AmesosClass <<
" not built in this executable " << std::endl ;
275 NumErrors += Errors ;
277 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
278 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
282 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
283 if ( MyVerbose && Errors ) {
284 std::cout << AmesosClass <<
" failed with transpose = " <<
285 (transpose?
"true":
"false") << std::endl ;
293 ParamList.
set(
"NoDestroy",
true );
294 ParamList.
set(
"MaxProcs", 2 );
299 if (MyVerbose) std::cout << __FILE__ <<
"::" << __LINE__ <<
" AmesosClass= " << AmesosClass
300 <<
" ParamList = " << ParamList
301 <<
" transpose = " << transpose
302 <<
" Levels = " << Levels
315 relresidual, ExpectedError ) ;
317 if (MyVerbose || ( Errors && iam==0 ) ) std::cout << __FILE__ <<
"::" << __LINE__
318 <<
" AmesosClass= " << AmesosClass
319 <<
" Errors = " << Errors
323 if (MyVerbose ) std::cout << AmesosClass <<
" not built in this executable " << std::endl ;
326 NumErrors += Errors ;
328 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
329 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
333 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
334 if ( MyVerbose && Errors ) {
335 std::cout << AmesosClass <<
" failed with transpose = " <<
336 (transpose?
"true":
"false") << std::endl ;
347 ParamList.
set(
"NoDestroy",
true );
348 ParamList.
set(
"ComputeTrueResidual",
true );
363 relresidual, ExpectedError ) ;
366 if (MyVerbose ) std::cout << AmesosClass <<
" not built in this executable " << std::endl ;
369 NumErrors += Errors ;
371 maxrelerror =
EPETRA_MAX( relerror, maxrelerror ) ;
372 maxrelresidual =
EPETRA_MAX( relresidual, maxrelresidual ) ;
376 if (MyVerbose) std::cout <<
" TestOtherClasses " << AmesosClass <<
"" <<
"::" << __LINE__ <<
" NumErrors = " << NumErrors << std::endl ;
377 if ( MyVerbose && Errors > 0 ) {
378 std::cout << AmesosClass <<
" failed with transpose = " <<
379 (transpose?
"true":
"false") << std::endl ;
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
virtual int MyPID() const =0
const Epetra_Comm & Comm() const
int TestOtherClasses(const char *AmesosClass, int EpetraMatrixType, Epetra_CrsMatrix *&Amat, const bool transpose, const bool verbose, const int Levels, const double Rcond, bool RowMapEqualsColMap, bool TestAddZeroToDiag, int ExpectedError, double &maxrelerror, double &maxrelresidual, int &NumTests)