26 #include "Amesos_ConfigDefs.h"
34 template<
typename Scalar>
38 solver = factory.Create(solver_type, problem);
39 assert(solver !=
nullptr);
46 template<
typename Scalar>
56 template<
typename Scalar>
62 template<
typename Scalar>
65 return factory.Query(name);
68 template<
typename Scalar>
71 solver->SetUseTranspose(use_transpose);
74 template<
typename Scalar>
77 return solver->UseTranspose();
80 template<
typename Scalar>
90 assert(rhs !=
nullptr);
94 problem.SetOperator(m->mat);
95 problem.SetRHS(rhs->vec);
96 Epetra_Vector x(*rhs->std_map);
99 if (!setup_factorization())
100 this->warn(
"AmesosSolver: LU factorization could not be completed");
102 int status = solver->Solve();
107 this->time = this->accumulated();
109 free_with_check(this->sln);
110 this->sln = malloc_with_check<AmesosSolver<double>,
double>(m->
size,
this);
112 memset(this->sln, 0, m->
size *
sizeof(
double));
114 for (
unsigned int i = 0; i < m->
size; i++)
121 assert(m !=
nullptr);
122 assert(rhs !=
nullptr);
128 if (!setup_factorization())
129 this->warn(
"AmesosSolver: LU factorization could not be completed");
131 int status = solver->Solve();
136 this->time = this->accumulated();
138 free_with_check(this->sln);
139 this->sln = malloc_with_check<AmesosSolver<std::complex<double> >, std::complex<double>>(m->
size,
this);
141 memset(this->sln, 0, m->
size *
sizeof(std::complex<double>));
144 template<
typename Scalar>
150 solver->NumSymbolicFact() == 0 && solver->NumNumericFact() == 0)
153 eff_fact_scheme = this->reuse_scheme;
156 switch (eff_fact_scheme)
160 status = solver->SymbolicFactorization();
163 this->warn(
"Symbolic factorization failed.");
169 status = solver->NumericFactorization();
172 this->warn(
"Numeric factorization failed.");
AmesosSolver class as an interface to Amesos.
General namespace for the Hermes library.
Exception interface Basically a std::exception, but with a constructor with string and with print_msg...
unsigned int size
matrix size
Encapsulation of Amesos linear solver.
existing factorization data.
File containing functionality for investigating call stack.
pattern as the one already factorized.
unsigned int size
size of vector