29 #ifndef OOMPH_EIGEN_SOLVER_HEADER
30 #define OOMPH_EIGEN_SOLVER_HEADER
34 #include <oomph-lib-config.h>
51 class DoubleMatrixBase;
91 Vector<std::complex<double>>& eigenvalue,
94 const bool& do_adjoint_problem =
false)
109 unsigned n = alpha.size();
110 eigenvalue.resize(n);
111 for (
unsigned i = 0;
i < n;
i++)
113 eigenvalue[
i] = alpha[
i] / beta[
i];
131 Vector<std::complex<double>>& alpha,
135 const bool& do_adjoint_problem =
false) = 0;
186 Vector<std::complex<double>>& alpha,
190 const bool& do_adjoint_problem =
false);
198 Vector<std::complex<double>>& eigenvalue,
221 Vector<std::complex<double>>& alpha,
230 std::ostringstream error_stream;
231 error_stream <<
"Failure in LAPACK_DGGEV(...).\n"
232 <<
"info = " << info << std::endl;
234 <<
"Diagnostics below are from \n\n"
235 <<
"http://www.netlib.org/lapack/explore-html/d9/d8e/"
236 "group__double_g_eeigen_ga4f59e87e670a755b41cbdd7e97f36bea.html"
240 error_stream << -info <<
"-th input arg had an illegal value\n";
244 error_stream <<
"The QZ iteration failed. No eigenvectors have been\n"
245 <<
"calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)\n"
246 <<
"should be correct for j=INFO+1,...,N, where \n"
247 <<
"info = " << info <<
" and N = " << n << std::endl;
249 else if (info == (n + 1))
251 error_stream <<
"QZ iteration failed in DHGEQZ.\n";
253 else if (info == (n + 2))
255 error_stream <<
"error return from DTGEVC.\n";
258 <<
"Aborting here; if you know how to proceed then\n"
259 <<
"then implement ability to catch this error and continue\n";
262 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
269 std::ostringstream error_stream;
270 error_stream <<
"Failure in LAPACK_ZGGEV(...).\n"
271 <<
"info = " << info << std::endl;
272 error_stream <<
"Diagnostics below are from \n\n"
273 <<
"http://www.netlib.org/lapack/explore-html/"
274 <<
"db/d55/group__complex16_g_eeigen_ga79fcce20c"
275 <<
"617429ccf985e6f123a6171.html" << std::endl;
278 error_stream << -info <<
"-th input arg had an illegal value\n";
282 error_stream <<
"The QZ iteration failed. No eigenvectors have been\n"
283 <<
"calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)\n"
284 <<
"should be correct for j=INFO+1,...,N, where \n"
285 <<
"info = " << info <<
" and N = " << n << std::endl;
287 else if (info == (n + 1))
289 error_stream <<
"QZ iteration failed in ZHGEQZ.\n";
291 else if (info == (n + 2))
293 error_stream <<
"error return from ZTGEVC.\n";
296 <<
"Aborting here; if you know how to proceed then\n"
297 <<
"then implement ability to catch this error and continue\n";
300 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
Abstract base class for matrices of complex doubles – adds abstract interfaces for solving,...
Base class for any linear algebra object that is distributable. Just contains storage for the LinearA...
Base class for all EigenProblem solves. This simply defines standard interfaces so that different sol...
virtual ~EigenSolver()
Empty destructor.
EigenSolver(const EigenSolver &)
Empty copy constructor.
EigenSolver()
Empty constructor.
void set_shift(const double &shift_value)
Set the value of the (real) shift.
virtual void solve_eigenproblem(Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &alpha, Vector< double > &beta, Vector< DoubleVector > &eigenvector_real, Vector< DoubleVector > &eigenvector_imag, const bool &do_adjoint_problem=false)=0
Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object....
double Sigma_real
Double value that represents the real part of the shift in shifted eigensolvers.
virtual void solve_eigenproblem(Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector_real, Vector< DoubleVector > &eigenvector_imag, const bool &do_adjoint_problem=false)
Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object....
const double & get_shift() const
Return the value of the (real) shift (const version)
Class for the LAPACK QZ eigensolver.
void ZGGEV_error(const int &info, const int &n)
Provide diagonstic for ZGGEV error return.
void solve_eigenproblem_helper(Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &alpha, Vector< double > &beta, Vector< DoubleVector > &eigenvector)
Helper function called from "raw" lapack code.
void find_eigenvalues(const ComplexMatrixBase &A, const ComplexMatrixBase &M, Vector< std::complex< double >> &eigenvalue, Vector< Vector< std::complex< double >>> &eigenvector)
Find the eigenvalues of a complex generalised eigenvalue problem specified by . Note: the (real) shif...
double tolerance_for_ccness_check() const
Access to tolerance for checking complex conjugateness of eigenvalues (const version)
void operator=(const LAPACK_QZ &)=delete
Broken assignment operator.
void solve_eigenproblem(Problem *const &problem_pt, const int &n_eval, Vector< std::complex< double >> &alpha, Vector< double > &beta, Vector< DoubleVector > &eigenvector_real, Vector< DoubleVector > &eigenvector_imag, const bool &do_adjoint_problem=false)
Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object....
void DGGEV_error(const int &info, const int &n)
Provide diagonstic for DGGEV error return.
double Tolerance_for_ccness_check
Tolerance for checking complex conjugateness of eigenvalues.
virtual ~LAPACK_QZ()
Empty desctructor.
LAPACK_QZ()
Empty constructor.
LAPACK_QZ(const LAPACK_QZ &)=delete
Broken copy constructor.
double & tolerance_for_ccness_check()
Access to tolerance for checking complex conjugateness of eigenvalues.
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...