12#include "basics/warnings/push.h"
13#include "basics/warnings/ignore_warning_overloaded_virtual.h"
17#include <eigensolver/arpackpp/arscomp.h>
18#include <eigensolver/arpackpp/argcomp.h>
20#include <eigensolver/arpackpp/argsym.h>
23#include "basics/warnings/pop.h"
57 for (uint i = 0; i < OP_.
dimY(); ++i)
68 template<
class T,
class U,
class V>
80 OP_(OP), A_(A), B_(B) {
95 for (uint i = 0; i < A_.
dimY(); ++i)
109 for (uint i = 0; i < B_.
dimY(); ++i)
123 for (uint i = 0; i < OP_.
dimY(); ++i)
142 for (uint i = 0; i < OP_.
dimY(); ++i)
179 whichEV_((char *)
"LM"),
180 modus_(
ArPack<Real>::SHIFTINV),
184 whichEV_, 0, tol, maxiter),
186 if (kmax < 1 || kmax > ((
int)OP.
dimX() - 2))
208 char* which = (
char*)
"LM",
212 modus_(
ArPack<Real>::SHIFTINV),
216 whichEV_, 0, tol, maxiter),
218 if (kmax < 1 || kmax > ((
int)OP.
dimX() - 2))
226 for (uint i = 0; i < this->arpackSolver_.EigenvectorsFound(); ++i)
227 delete eigenVectors_[i];
249 return eigenVectors_;
259 return convEigenvalues_;
265 this->arpackSolver_.GetN());
270 virtual std::ostream&
275 os <<
"regular inverse mode \n";
278 os <<
"shift-invert mode \n";
281 os <<
"normal mode \n";
284 os <<
"shift-invert mode \n";
293 int numOfVecs = this->arpackSolver_.FindEigenvectors();
294 eigenValues_.
resize(this->arpackSolver_.ConvergedEigenvalues());
296 for (
int i = 0; i < this->arpackSolver_.ConvergedEigenvalues(); ++i) {
297 eigenValues_[i] = this->arpackSolver_.Eigenvalue(i);
299 eigenVectors_.
resize(this->arpackSolver_.GetN());
300 for (
int i = 0; i < numOfVecs; ++i)
302 this->arpackSolver_.GetN(), this->arpackSolver_.RawEigenvectors()
303 + i * this->arpackSolver_.GetN());
306 iter_ = arpackSolver_.GetIter();
307 convEigenvalues_ = arpackSolver_.ConvergedEigenvalues();
315 ArPack<Real>::modus modus_;
321 ArpackStdOperatorWrapper<T> aow_;
324 ARCompStdEig<Real, ArpackStdOperatorWrapper<T> > arpackSolver_;
330 uint convEigenvalues_;
434 for (uint i = 0; i < this->arpackSolver_.EigenvectorsFound(); ++i)
435 delete eigenVectors_[i];
455 return eigenVectors_;
465 return convEigenvalues_;
471 this->arpackSolver_.GetN());
476 virtual std::ostream&
info(std::ostream& os)
const {
480 os <<
"regular inverse mode" << std::endl;
483 os <<
"shift-invert mode" << std::endl;
486 os <<
"normal mode" << std::endl;
489 os <<
"shift-invert mode" << std::endl;
521 uint convEigenvalues_;
540 template<
class F,
class G,
class H = concepts::Real>
564 whichEV_((char*)
"LM"),
565 modus_(
ArPack<Real>::SHIFTINV),
580 if (kmax < 1 || kmax > ((
int)OP.
dimX() - 2))
607 char* which = (
char*)
"LM",
611 modus_(
ArPack<Real>::SHIFTINV),
625 if (kmax < 1 || kmax > ((
int)OP.
dimX() - 2))
633 for (uint i = 0; i < this->arpackSolver_.EigenvectorsFound(); ++i)
634 delete eigenVectors_[i];
656 return eigenVectors_;
666 return convEigenvalues_;
672 this->arpackSolver_.GetN());
676 virtual std::ostream&
681 os <<
"regular inverse mode" << std::endl;
684 os <<
"shift-invert mode" << std::endl;
687 os <<
"normal mode" << std::endl;
690 os <<
"shift-invert mode" << std::endl;
699 int numOfVecs = this->arpackSolver_.FindEigenvectors();
700 eigenValues_.
resize(this->arpackSolver_.ConvergedEigenvalues());
702 for (
int i = 0; i < this->arpackSolver_.ConvergedEigenvalues(); ++i) {
703 eigenValues_[i] = this->arpackSolver_.Eigenvalue(i);
705 eigenVectors_.
resize(this->arpackSolver_.GetN());
706 for (
int i = 0; i < numOfVecs; ++i)
708 this->arpackSolver_.GetN(), this->arpackSolver_.RawEigenvectors()
709 + i * this->arpackSolver_.GetN());
712 iter_ = arpackSolver_.GetIter();
713 convEigenvalues_ = arpackSolver_.ConvergedEigenvalues();
721 ArPack<Real>::modus modus_;
727 ArpackOperatorWrapper<F, G, H> aow_;
730 ARCompGenEig<Real, ArpackOperatorWrapper<F, G, H> , ArpackOperatorWrapper<
731 F, G, H> > arpackSolver_;
737 uint convEigenvalues_;
#define conceptsException(exc)
void resize(const uint sz)
virtual const uint dimY() const
virtual const uint dimX() const
concepts::Array< Cmplx > getRESID()
Returns the RESID vector.
virtual ~ArPackppGen()
Deconstructor.
virtual uint iterations() const
Returns the actual number of Arnoldi iterations.
virtual uint converged() const
Returns the number of converged eigenpairs.
ArPackppGen(concepts::Operator< F > &OP, concepts::Operator< G > &A, concepts::Operator< H > &B, int kmax=1, concepts::Cmplx sigma=0.0, Real tol=0.0, int maxiter=300)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
ArPackppGen(concepts::Operator< F > &OP, concepts::Operator< G > &A, concepts::Operator< H > &B, int kmax=1, char *which=(char *) "LM", Real tol=0.0, int maxiter=300)
virtual const concepts::Array< Cmplx > & getEV()
virtual concepts::Array< concepts::Vector< Cmplx > * > & getEF()
virtual uint converged() const
Returns the number of converged eigenpairs.
virtual ~ArPackppStd()
Deconstructor.
ArPackppStd(concepts::Operator< T > &OP, int kmax=1, concepts::Cmplx sigma=0.0, Real tol=0.0, int maxiter=300)
ArPackppStd(concepts::Operator< T > &OP, int kmax=1, char *which=(char *) "LM", Real tol=0.0, int maxiter=300)
virtual concepts::Array< concepts::Vector< Cmplx > * > & getEF()
virtual const concepts::Array< Cmplx > & getEV()
concepts::Array< Cmplx > getRESID()
Returns the RESID vector.
virtual uint iterations() const
Returns the actual number of Arnoldi iterations.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual uint converged() const
Returns the number of converged eigenpairs.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual uint iterations() const
Returns the actual number of Arnoldi iterations.
virtual ~ArPackppSymGen()
Deconstructor.
concepts::Array< Real > getRESID()
Returns the RESID vector.
virtual const concepts::Array< Real > & getEV()
ArPackppSymGen(char invertType, concepts::Operator< Real > &OP, concepts::Operator< Real > &A, int kmax=1, Real sigma=0.1, Real tol=0.0, int maxiter=300)
virtual concepts::Array< concepts::Vector< Real > * > & getEF()
ArPackppSymGen(concepts::Operator< Real > &OP, concepts::Operator< Real > &A, concepts::Operator< Real > &B, int kmax=1, Real sigma=0.1, Real tol=0.0, int maxiter=300)
ArpackOperatorWrapper(concepts::Operator< T > &OP, concepts::Operator< U > &A, concepts::Operator< V > &B)
void multOPxRegular(S *v, S *w)
ArpackStdOperatorWrapper(concepts::Operator< T > &OP)
std::string typeOf(const T &t)
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.