Class for the LAPACK QZ eigensolver. More...
#include <eigen_solver.h>
Public Member Functions | |
LAPACK_QZ () | |
Empty constructor. More... | |
LAPACK_QZ (const LAPACK_QZ &)=delete | |
Broken copy constructor. More... | |
void | operator= (const LAPACK_QZ &)=delete |
Broken assignment operator. More... | |
virtual | ~LAPACK_QZ () |
Empty desctructor. More... | |
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. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex. Eigenvalues may be infinite and are therefore returned as where is complex while is real. The actual eigenvalues may then be computed by doing the division, checking for zero betas to avoid NaNs. There's a convenience wrapper to this function that simply computes these eigenvalues regardless. That version may die in NaN checking is enabled (via the fenv.h header and the associated feenable function). At least n_eval eigenvalues are computed. More... | |
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) shift that's specifiable via the EigenSolver base class is ignored here. A warning gets issued if it's set to a nonzero value. More... | |
double | tolerance_for_ccness_check () const |
Access to tolerance for checking complex conjugateness of eigenvalues (const version) More... | |
double & | tolerance_for_ccness_check () |
Access to tolerance for checking complex conjugateness of eigenvalues. More... | |
Public Member Functions inherited from oomph::EigenSolver | |
EigenSolver () | |
Empty constructor. More... | |
EigenSolver (const EigenSolver &) | |
Empty copy constructor. More... | |
virtual | ~EigenSolver () |
Empty destructor. More... | |
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. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex, and the eigenvalues can be NaNs or Infs. This function is therefore merely provided as a convenience, to be used if the user is confident that NaNs don't arise (e.g. in Arnoldi based solvers where typically only a small number of (finite) eigenvalues are computed), or if the users is happy to deal with NaNs in the subsequent post-processing. Function is virtual so it can be overloaded for Arnoldi type solvers that compute the (finite) eigenvalues directly At least n_eval eigenvalues are computed. More... | |
void | set_shift (const double &shift_value) |
Set the value of the (real) shift. More... | |
const double & | get_shift () const |
Return the value of the (real) shift (const version) More... | |
Public Member Functions inherited from oomph::DistributableLinearAlgebraObject | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
if the communicator_pt is null then the distribution is not setup then false is returned, otherwise return true More... | |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
setup the distribution of this distributable linear algebra object More... | |
void | build_distribution (const LinearAlgebraDistribution &dist) |
setup the distribution of this distributable linear algebra object More... | |
Private Member Functions | |
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. More... | |
void | DGGEV_error (const int &info, const int &n) |
Provide diagonstic for DGGEV error return. More... | |
void | ZGGEV_error (const int &info, const int &n) |
Provide diagonstic for ZGGEV error return. More... | |
Private Attributes | |
double | Tolerance_for_ccness_check |
Tolerance for checking complex conjugateness of eigenvalues. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object More... | |
Protected Attributes inherited from oomph::EigenSolver | |
double | Sigma_real |
Double value that represents the real part of the shift in shifted eigensolvers. More... | |
Class for the LAPACK QZ eigensolver.
Definition at line 157 of file eigen_solver.h.
|
inline |
Empty constructor.
Definition at line 161 of file eigen_solver.h.
|
delete |
Broken copy constructor.
|
inlinevirtual |
Empty desctructor.
Definition at line 170 of file eigen_solver.h.
|
inlineprivate |
Provide diagonstic for DGGEV error return.
Definition at line 227 of file eigen_solver.h.
Referenced by solve_eigenproblem_helper().
void oomph::LAPACK_QZ::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) shift that's specifiable via the EigenSolver base class is ignored here. A warning gets issued if it's set to a nonzero value.
Use LAPACK to solve a complex eigen problem specified by the given matrices. Note: the (real) shift that's specifiable via the EigenSolver base class is ignored here. A warning gets issued if it's set to a nonzero value.
Definition at line 401 of file eigen_solver.cc.
References i, oomph::ComplexMatrixBase::nrow(), oomph::EigenSolver::Sigma_real, and ZGGEV_error().
|
delete |
Broken assignment operator.
|
virtual |
Solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex. Eigenvalues may be infinite and are therefore returned as where is complex while is real. The actual eigenvalues may then be computed by doing the division, checking for zero betas to avoid NaNs. There's a convenience wrapper to this function that simply computes these eigenvalues regardless. That version may die in NaN checking is enabled (via the fenv.h header and the associated feenable function). At least n_eval eigenvalues are computed.
Implements oomph::EigenSolver.
Definition at line 266 of file eigen_solver.cc.
References oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::ndof(), solve_eigenproblem_helper(), and Tolerance_for_ccness_check.
|
private |
Helper function called from "raw" lapack code.
Use LAPACK QZ to solve the real eigenproblem that is assembled by elements in a mesh in a Problem object. Note that the assembled matrices include the shift and are real. The eigenvalues and eigenvectors are, in general, complex. Eigenvalues may be infinite and are therefore returned as where is complex while is real. The actual eigenvalues may then be computed by doing the division, checking for zero betas to avoid NaNs. This is actually a helper function that stores re & imag parts of eigenvectors in a collection of real vectors; they are disentangled in the alternative version of this function that returns Vectors of complex vectors. At least n_eval eigenvalues are computed.
Definition at line 65 of file eigen_solver.cc.
References oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::Problem::communicator_pt(), DGGEV_error(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::get_eigenproblem_matrices(), i, oomph::Problem::ndof(), and oomph::EigenSolver::Sigma_real.
Referenced by solve_eigenproblem().
|
inline |
Access to tolerance for checking complex conjugateness of eigenvalues.
Definition at line 211 of file eigen_solver.h.
References Tolerance_for_ccness_check.
|
inline |
Access to tolerance for checking complex conjugateness of eigenvalues (const version)
Definition at line 204 of file eigen_solver.h.
References Tolerance_for_ccness_check.
|
inlineprivate |
Provide diagonstic for ZGGEV error return.
Definition at line 266 of file eigen_solver.h.
Referenced by find_eigenvalues().
|
private |
Tolerance for checking complex conjugateness of eigenvalues.
Definition at line 304 of file eigen_solver.h.
Referenced by solve_eigenproblem(), and tolerance_for_ccness_check().