ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hegvd_op.h
Go to the documentation of this file.
1
4
5// named HEGVD, actually includes HE/SY GV/GVD/GVX
6
7#ifndef MODULE_HSOLVER_HEGVD_H
8#define MODULE_HSOLVER_HEGVD_H
9
12
13#include <cassert>
14
15// Note:
16// names follow the same style as standard LAPACK APIs:
17// -----------------------------------
18// he stands for Hermitian
19// sy stands for Symmetric
20// gv stands for Generalized eigenValue problem
21// ev stands for EigenValues
22// dn stands for dense, maybe, who knows?
23// x stands for compute a subset of the eigenvalues and, optionally,
24// their corresponding eigenvectors
25// d for all, x for selected
26// gv: all, gvd: all/devide-and-conquer, x: selected eigenvalues
27// -----------------------------------
28// search for docs using the op function name as keywords.
29
30// TODO: This is a temperary location for these functions.
31// And will be moved to a global module(module base) later.
32
33#include "source_base/macros.h"
34
35namespace hsolver
36{
37
38inline double get_real(const std::complex<double> &x) { return x.real(); }
39
40inline float get_real(const std::complex<float> &x) { return x.real(); }
41
42inline double get_real(const double &x) { return x; }
43
44inline float get_real(const float &x) { return x; }
45
46
47template <typename T, typename Device>
49{
50 using Real = typename GetTypeReal<T>::type;
70 void operator()(const Device* d, const int nstart, const int ldh, const T* A, T* B, Real* W, T* V);
71};
72
73// template <typename T, typename Device>
74// struct hegv_op
75// {
76// using Real = typename GetTypeReal<T>::type;
77// /// @brief HEGV computes first m eigenvalues and eigenvectors of a complex generalized
78// /// Input Parameters
79// /// @param d : the type of device
80// /// @param nbase : the number of dim of the matrix
81// /// @param ldh : the number of dmx of the matrix
82// /// @param A : the hermitian matrix A in A x=lambda B x (col major)
83// /// @param B : the overlap matrix B in A x=lambda B x (col major)
84// /// Output Parameter
85// /// @param W : calculated eigenvalues
86// /// @param V : calculated eigenvectors (col major)
87// void operator()(const Device* d, const int nstart, const int ldh, const T* A, T* B, Real* W, T* V);
88// };
89
90template <typename T, typename Device>
92{
93 using Real = typename GetTypeReal<T>::type;
105 void operator()(const Device* d, const int nstart, const int ldh, T* A, T* B, const int m, Real* W, T* V);
106};
107
108template <typename T, typename Device>
110{
111 using Real = typename GetTypeReal<T>::type;
131 void operator()(const Device *d, const int ndim, const int lda, const T *A, const int neig, Real *w, T *z);
132};
133
134#if __CUDA || __UT_USE_CUDA || __ROCM || __UT_USE_ROCM
135
136void createGpuSolverHandle();
137void destroyGpuSolverHandle();
138
139#endif
140
141} // namespace hsolver
142
143#endif // !MODULE_HSOLVER_HEGVD_H
#define T
Definition exp.cpp:237
Definition diag_comm_info.h:9
double get_real(const std::complex< double > &x)
Definition hegvd_op.h:38
T type
Definition macros.h:8
Definition hegvd_op.h:110
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:111
void operator()(const Device *d, const int ndim, const int lda, const T *A, const int neig, Real *w, T *z)
heevx computes the first m eigenvalues and their corresponding eigenvectors of a complex generalized ...
Definition hegvd_op.h:49
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:50
void operator()(const Device *d, const int nstart, const int ldh, const T *A, T *B, Real *W, T *V)
HEGVD computes all the eigenvalues and eigenvectors of a complex generalized Hermitian-definite eigen...
Definition hegvd_op.h:92
void operator()(const Device *d, const int nstart, const int ldh, T *A, T *B, const int m, Real *W, T *V)
HEGVX computes first m eigenvalues and eigenvectors of a complex generalized Input Parameters.
typename GetTypeReal< T >::type Real
Definition hegvd_op.h:93