29 #include "Amesos_config.h"
32 #ifdef HAVE_AMESOS_LAPACK
35 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
38 #ifdef HAVE_AMESOS_SCALAPACK
41 #ifdef HAVE_AMESOS_UMFPACK
44 #ifdef HAVE_AMESOS_SUPERLUDIST
47 #ifdef HAVE_AMESOS_SUPERLU
50 #ifdef HAVE_AMESOS_DSCPACK
53 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
56 #ifdef HAVE_AMESOS_TAUCS
59 #ifdef HAVE_AMESOS_PARAKLETE
62 #ifdef HAVE_AMESOS_CSPARSE
72 std::string CT = ClassType;
73 return(
Create(CT,LinearProblem));
80 if ((CT ==
"Amesos_Lapack") || (CT ==
"Lapack")) {
81 #ifdef HAVE_AMESOS_LAPACK
84 if (
verbose) std::cerr <<
"Amesos_Lapack is not implemented" << std::endl ;
89 if ((CT ==
"Amesos_Klu") || (CT ==
"Klu")) {
90 #ifdef HAVE_AMESOS_KLU
93 if (
verbose) std::cerr <<
"Amesos_Klu is not implemented" << std::endl ;
98 if ((CT ==
"Amesos_Umfpack") || (CT ==
"Umfpack")) {
99 #ifdef HAVE_AMESOS_UMFPACK
102 if (
verbose) std::cerr <<
"Amesos_Umfpack is not implemented" << std::endl ;
107 if ((CT ==
"Amesos_Superlu") || (CT ==
"Superlu")) {
108 #ifdef HAVE_AMESOS_SUPERLU
111 if (
verbose) std::cerr <<
"Amesos_Superlu is not implemented" << std::endl ;
116 if ((CT ==
"Amesos_Superludist") || (CT ==
"Superludist")) {
117 #ifdef HAVE_AMESOS_SUPERLUDIST
120 if (
verbose) std::cerr <<
"Amesos_Superludist is not implemented" << std::endl ;
125 if ((CT ==
"Amesos_Mumps") || (CT ==
"Mumps")) {
126 #if defined(HAVE_AMESOS_MUMPS) && defined(HAVE_MPI)
129 if (
verbose) std::cerr <<
"Amesos_Mumps is not implemented" << std::endl ;
134 if ((CT ==
"Amesos_Scalapack") || (CT ==
"Scalapack")) {
135 #ifdef HAVE_AMESOS_SCALAPACK
138 if (
verbose) std::cerr <<
"Amesos_Scalapack is not implemented" << std::endl ;
143 if ((CT ==
"Amesos_Dscpack") || (CT ==
"Dscpack")) {
144 #ifdef HAVE_AMESOS_DSCPACK
147 if (
verbose) std::cerr <<
"Amesos_Dscpack is not implemented" << std::endl ;
152 if ((CT ==
"Amesos_Pardiso") || (CT ==
"Pardiso")) {
153 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
156 if (
verbose) std::cerr <<
"Amesos_Pardiso is not implemented" << std::endl ;
161 if ((CT ==
"Amesos_Paraklete") || (CT ==
"Paraklete")) {
162 #ifdef HAVE_AMESOS_PARAKLETE
165 if (
verbose) std::cerr <<
"Amesos_Paraklete is not implemented" << std::endl ;
170 if ((CT ==
"Amesos_Taucs") || (CT ==
"Taucs")) {
171 #ifdef HAVE_AMESOS_TAUCS
174 if (
verbose) std::cerr <<
"Amesos_Taucs is not implemented" << std::endl ;
179 if ((CT ==
"Amesos_CSparse") || (CT ==
"CSparse")) {
180 #ifdef HAVE_AMESOS_CSPARSE
181 return new Amesos_CSparse(LinearProblem);
183 if (
verbose) std::cerr <<
"Amesos_CSparse is not implemented" << std::endl ;
188 if (
verbose) std::cerr <<
"Unknown class type:" << CT << std::endl ;
195 std::string CT = ClassType;
203 if ((CT ==
"Amesos_Lapack") || (CT ==
"Lapack")) {
204 #ifdef HAVE_AMESOS_LAPACK
211 if ((CT ==
"Amesos_Klu") || (CT ==
"Klu")) {
212 #ifdef HAVE_AMESOS_KLU
219 if ((CT ==
"Amesos_Umfpack") || (CT ==
"Umfpack")) {
220 #ifdef HAVE_AMESOS_UMFPACK
227 if ((CT ==
"Amesos_Superlu") || ( CT ==
"Superlu")) {
228 #ifdef HAVE_AMESOS_SUPERLU
235 if ((CT ==
"Amesos_Superludist") || (CT ==
"Superludist")) {
236 #ifdef HAVE_AMESOS_SUPERLUDIST
243 if ((CT ==
"Amesos_Mumps") || (CT ==
"Mumps")) {
244 #ifdef HAVE_AMESOS_MUMPS
251 if ((CT ==
"Amesos_Scalapack") || (CT ==
"Scalapack")) {
252 #ifdef HAVE_AMESOS_SCALAPACK
259 if ((CT ==
"Amesos_Dscpack") || (CT ==
"Dscpack")) {
260 #ifdef HAVE_AMESOS_DSCPACK
267 if ((CT ==
"Amesos_Pardiso") || (CT ==
"Pardiso")) {
268 #if defined(HAVE_AMESOS_PARDISO) || defined(HAVE_AMESOS_PARDISO_MKL)
275 if ((CT ==
"Amesos_Taucs") || (CT ==
"Taucs")) {
276 #ifdef HAVE_AMESOS_TAUCS
283 if ((CT ==
"Amesos_Paraklete") || (CT ==
"Paraklete")) {
284 #ifdef HAVE_AMESOS_PARAKLETE
291 if ((CT ==
"Amesos_CSparse") || (CT ==
"CSparse")) {
292 #ifdef HAVE_AMESOS_CSPARSE
308 ParamList.
set(
"OutputLevel",1 ) ;
309 ParamList.
set(
"DebugLevel", 0 ) ;
310 ParamList.
set(
"PrintTiming",
false ) ;
311 ParamList.
set(
"ComputeVectorNorms",
false ) ;
312 ParamList.
set(
"ComputeTrueResidual",
false ) ;
316 ParamList.
set(
"AddZeroToDiag",
false ) ;
317 ParamList.
set(
"AddToDiag", 0.0 ) ;
318 ParamList.
set(
"Refactorize",
false ) ;
319 ParamList.
set(
"RcondThreshold", 1e-12 ) ;
320 ParamList.
set(
"MaxProcs", -1 ) ;
321 ParamList.
set(
"MatrixProperty",
"general" ) ;
322 ParamList.
set(
"ScaleMethod", 0 ) ;
323 ParamList.
set(
"Reindex",
false ) ;
327 ParamList.
set(
"TrustMe",
false ) ;
334 ParamList.
set(
"Redistribute",
false ) ;
337 SuperludistParams.
set(
"ReuseSymbolic",
false);
338 SuperludistParams.
set(
"Fact",
"SamePattern");
339 SuperludistParams.
set(
"Equil",
false);
340 SuperludistParams.
set(
"ColPerm",
"NOT SET");
341 SuperludistParams.
set(
"RowPerm",
"NOT SET");
342 SuperludistParams.
set(
"perm_c",(
int*) 0);
343 SuperludistParams.
set(
"perm_r",(
int*) 0);
344 SuperludistParams.
set(
"IterRefine",
"NOT SET");
345 SuperludistParams.
set(
"ReplaceTinyPivot",
true);
346 SuperludistParams.
set(
"PrintNonzeros",
false);
348 ParamList.
set(
"Superludist", SuperludistParams ) ;
354 LapackParams.
set(
"Equilibrate",
true);
356 ParamList.
set(
"Lapack", LapackParams ) ;
358 ParamList.
set(
"NoDestroy",
false);
361 MumpsParams.
set(
"Equilibrate",
true);
363 for (
int i = 1 ; i <= 40 ; ++i)
366 sprintf(what,
"ICNTL(%d)", i);
368 MumpsParams.
set(what,0);
372 for (
int i = 1 ; i <= 5 ; ++i)
375 sprintf(what,
"CNTL(%d)", i);
377 MumpsParams.
set(what,0.0);
379 MumpsParams.
set(
"RowScaling",(
double *) 0);
380 MumpsParams.
set(
"ColScaling",(
double *) 0);
383 ParamList.
set(
"Mumps", MumpsParams ) ;
390 PardisoParams.
set(
"MSGLVL",0);
391 PardisoParams.
set(
"IPARM(1)",0);
392 PardisoParams.
set(
"IPARM(2)",0);
393 PardisoParams.
set(
"IPARM(3)",0);
394 PardisoParams.
set(
"IPARM(4)",0);
395 PardisoParams.
set(
"IPARM(8)",0);
396 PardisoParams.
set(
"IPARM(10)",0);
397 PardisoParams.
set(
"IPARM(11)",0);
398 PardisoParams.
set(
"IPARM(18)",0);
399 PardisoParams.
set(
"IPARM(19)",0);
400 PardisoParams.
set(
"IPARM(21)",0);
403 ParamList.
set(
"Pardiso", PardisoParams ) ;
408 ScalapackParams.
set(
"2D distribution",
true);
409 ScalapackParams.
set(
"grid_nb",32);
411 ParamList.
set(
"Scalapack", ScalapackParams ) ;
Amesos_Klu: A serial, unblocked code ideal for getting started and for very sparse matrices...
Amesos_Paraklete: A serial, unblocked code ideal for getting started and for very sparse matrices...
Amesos_Superludist: An object-oriented wrapper for Superludist.
Amesos_Mumps: An object-oriented wrapper for the double precision version of MUMPS.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Amesos_Dscpack: An object-oriented wrapper for Dscpack.
static Teuchos::ParameterList GetValidParameters()
Get the list of valid parameters.
Amesos_Pardiso: Interface to the PARDISO package.
Amesos_Superlu: Amesos interface to Xioye Li's SuperLU 3.0 serial code.
bool isParameter(const std::string &name) const
Amesos_Lapack: an interface to LAPACK.
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
Amesos Create method.
Amesos_BaseSolver: A pure virtual class for direct solution of real-valued double-precision operators...
Class Amesos_Umfpack: An object-oriented wrapper for UMFPACK.
Amesos_Scalapack: A serial and parallel dense solver. For now, we implement only the unsymmetric ScaL...
Amesos_Taucs: An interface to the TAUCS package.
bool Query(const char *ClassType)
Queries whether a given interface is available or not.