1#ifndef SCA_LAPACK_HERMITIAN_EIGEN_SYSTEM_DC_DEFINED
2# define SCA_LAPACK_HERMITIAN_EIGEN_STSTEM_DC_DEFINED
13template <
typename F =
double>
26 , integerWorkCount(-1)
28 , integerWork(nullptr) {
31 int optimalIntegerWork;
52 throw new EXCEPTION(
"ERROR: PDSYEVD initialization failed");
54 workCount =
static_cast<int>(optimalWork + 0.5);
55 integerWorkCount = optimalIntegerWork;
57 work =
new double[workCount];
58 integerWork =
new int[integerWorkCount];
62 if (work)
delete[] work;
63 if (integerWork)
delete[] integerWork;
65 integerWork =
nullptr;
89 throw new EXCEPTION(
"ERROR: PDSYEVD diagonlization failed");
94 std::shared_ptr<ScaLapackMatrix<double>>
A, U;
111 , integerWorkCount(-1)
114 , integerWork(nullptr) {
117 double optimalRealWork;
118 int optimalIntegerWork;
141 throw new EXCEPTION(
"ERROR: PZHEEVD initialization failed");
143 workCount =
static_cast<int>(std::real(optimalWork) + 0.5);
144 realWorkCount =
static_cast<int64_t
>(optimalRealWork + 0.5);
145 integerWorkCount = optimalIntegerWork;
149 realWork =
new double[2 * realWorkCount];
150 integerWork =
new int[integerWorkCount];
154 if (work)
delete[] work;
155 if (realWork)
delete[] realWork;
156 if (integerWork)
delete[] integerWork;
159 integerWork =
nullptr;
185 throw new EXCEPTION(
"ERROR: PZHEEVD diagonlization failed");
190 std::shared_ptr<ScaLapackMatrix<complex>>
A, U;
#define EXCEPTION(message)
Definition Exception.hpp:8
void pdsyevd_(const char *jobz, const char *upperLower, const int *m, const double *a, const int *ia, const int *ja, const int *desca, double *lambda, double *z, const int *iz, const int *jz, const int *descz, double *work, const int *lwork, int *iwork, const int *liwork, int *info)
void pzheevd_(const char *jobz, const char *upperLower, const int *m, const sisi4s::complex *a, const int *ia, const int *ja, const int *desca, double *lambda, sisi4s::complex *z, const int *iz, const int *jz, const int *descz, sisi4s::complex *work, const int *lwork, double *realWork, const int *lRealCount, int *iwork, const int *liwork, int *info)
int integerWorkCount
Definition ScaLapackHermitianEigenSystemDc.hpp:191
std::shared_ptr< ScaLapackMatrix< complex > > A
Definition ScaLapackHermitianEigenSystemDc.hpp:190
int * integerWork
Definition ScaLapackHermitianEigenSystemDc.hpp:194
ScaLapackHermitianEigenSystemDc(const std::shared_ptr< ScaLapackMatrix< complex > > &A_, const std::shared_ptr< ScaLapackMatrix< complex > > &U_)
Definition ScaLapackHermitianEigenSystemDc.hpp:104
double * realWork
Definition ScaLapackHermitianEigenSystemDc.hpp:193
void solve(double *lambda)
Definition ScaLapackHermitianEigenSystemDc.hpp:162
complex * work
Definition ScaLapackHermitianEigenSystemDc.hpp:192
~ScaLapackHermitianEigenSystemDc()
Definition ScaLapackHermitianEigenSystemDc.hpp:153
std::shared_ptr< ScaLapackMatrix< double > > A
Definition ScaLapackHermitianEigenSystemDc.hpp:94
void solve(double *lambda)
Definition ScaLapackHermitianEigenSystemDc.hpp:68
int * integerWork
Definition ScaLapackHermitianEigenSystemDc.hpp:97
int integerWorkCount
Definition ScaLapackHermitianEigenSystemDc.hpp:95
~ScaLapackHermitianEigenSystemDc()
Definition ScaLapackHermitianEigenSystemDc.hpp:61
double * work
Definition ScaLapackHermitianEigenSystemDc.hpp:96
ScaLapackHermitianEigenSystemDc(const std::shared_ptr< ScaLapackMatrix< double > > &A_, const std::shared_ptr< ScaLapackMatrix< double > > &U_)
Definition ScaLapackHermitianEigenSystemDc.hpp:20
Definition ScaLapackHermitianEigenSystemDc.hpp:14
Definition ScaLapackMatrix.hpp:22
Definition Algorithm.hpp:10
Complex< real > complex
Definition Complex.hpp:17