ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
ModuleBase Namespace Reference

Namespaces

namespace  Global_File
 
namespace  GlobalFunc
 
namespace  libm
 

Classes

struct  apply_eigenvalues_op
 
class  Array_Pool
 Array_Pool is a class designed for dynamically allocating a two-dimensional array with all its elements contiguously arranged in memory. Compared to a two-dimensional vector, it offers better data locality because all elements are stored in a continuous block of memory. More...
 
struct  axpy_op
 
struct  axpy_op< T, base_device::DEVICE_CPU >
 
class  Bspline
 A class to treat Cardinal B-spline interpolation. More...
 
struct  cal_ylm_real_op
 
struct  cal_ylm_real_op< FPTYPE, base_device::DEVICE_CPU >
 
class  Chebyshev
 A class to treat the Chebyshev expansion. More...
 
class  Clebsch_Gordan
 
class  ComplexArray
 A basic type of data for complex array. More...
 
class  ComplexMatrix
 
class  CubicSpline
 Cubic spline interplation. More...
 
struct  dot_real_op
 
struct  dot_real_op< FPTYPE, base_device::DEVICE_CPU >
 
struct  dot_real_op< std::complex< FPTYPE >, base_device::DEVICE_CPU >
 
class  Element_Basis_Index
 
class  ErrorFunc
 
class  FFTW
 
class  FFTW< double >
 
struct  gemm_op
 
struct  gemm_op< T, base_device::DEVICE_CPU >
 
struct  gemv_op
 
struct  gemv_op< T, base_device::DEVICE_CPU >
 
class  Gram_Schmidt_Orth
 
class  IntArray
 Integer array. More...
 
class  Integral
 
class  Inverse_Matrix_Complex
 
class  Lebedev_laikov_grid
 
class  Mathzone
 atomic coordinates conversion functions More...
 
class  Mathzone_Add1
 
class  matrix
 
class  Matrix3
 3x3 matrix and related mathamatical operations More...
 
class  Matrix_Wrapper
 
struct  matrixCopy
 
struct  matrixCopy< T, base_device::DEVICE_CPU >
 
struct  matrixTranspose_op
 
struct  matrixTranspose_op< T, base_device::DEVICE_CPU >
 
class  Memory
 Record memory consumption during computation. More...
 
struct  normalize_op
 
struct  normalize_op< T, base_device::DEVICE_GPU >
 
class  Opt_CG
 A class designed to deal with optimization problems with CG method. Three forms of CG methods have been implemented, including standard flow to solve the linear equation Ax = b, Polak-Ribire (PR) form and Hager-Zhang (HZ) form to solve general optimization problems min{f(x)}. We adopt following abbreviation x -> solution d -> direction g -> gradient. More...
 
class  Opt_DCsrch
 A interface to line search. More...
 
class  Opt_TN
 A class designed to deal with optimization problems with Truncated-Newton (TN) method. At each step, the optimization direction d is determined by roughly solving linear equation Hd=-g, where H is Hessian matrix of f(x), and g is the gradient df(x)/dx. In this section, we get Hd by interpolation, and solve Hd=-g with CG method. We set three truncated conditions: 1) the residual of CG method has decreased more than 90%; 2) the number of CG iteration is more than 50; 3) the residual of CG method doesn't decrease and the CG iteration is larger than 9. More...
 
class  PGemmCN
 this class is used to perform parallel matrix multiplication C = alpha * A^H * B + beta * C Here, A and B are local matrices in each proc, C can be C_local or C_global, depending on the value of gatherC C_local is a local matrix in each proc C_global is a global matrix gathered from all procs and all procs have their own C_global matrix with the same C_global and C_local have the same LDC, but different column numbers values. More...
 
class  PolyInt
 
struct  precondition_op
 
class  Random
 
class  realArray
 double float array More...
 
struct  scal_op
 
struct  scal_op< FPTYPE, base_device::DEVICE_CPU >
 
class  Sph_Bessel_Recursive
 
class  Sph_Bessel_Recursive_Pool
 
class  Sphbes
 
class  SphericalBesselTransformer
 A class that provides spherical Bessel transforms. More...
 
class  timer
 Tracing computation time. More...
 
class  Vector3
 3 elements vector More...
 
struct  vector_add_vector_op
 
struct  vector_add_vector_op< T, base_device::DEVICE_CPU >
 
struct  vector_div_constant_op
 
struct  vector_div_constant_op< T, base_device::DEVICE_CPU >
 
struct  vector_div_vector_op
 
struct  vector_div_vector_op< T, base_device::DEVICE_CPU >
 
struct  vector_mul_real_op
 
struct  vector_mul_real_op< T, base_device::DEVICE_CPU >
 
struct  vector_mul_vector_op
 
struct  vector_mul_vector_op< T, base_device::DEVICE_CPU >
 
class  Ylm
 
class  YlmReal
 

Functions

void complexArrayxAlloc ()
 
ComplexArray operator* (const double r, const ComplexArray &cd)
 Scale a ComplexArray cd by real r.
 
ComplexArray operator* (const std::complex< double > c, const ComplexArray &cd)
 Scale a ComplexArray cd by std::complex number c.
 
double abs2 (const ComplexArray &cd)
 Sum of absolute squares of all elements in cd.
 
std::complex< double > dot (const ComplexArray &cd1, const ComplexArray &cd2)
 Take "dot-product" of two ComplexArray: sum of cd1(conjugate)[i] * cd2[i].
 
void scale_accumulate (double r, const ComplexArray &cd1, ComplexArray &cd2)
 Does cd2 += r * cd1.
 
void scale_accumulate (std::complex< double > c, const ComplexArray &cd1, ComplexArray &cd2)
 Does cd2 += c * cd1.
 
void scaled_sum (double r1, const ComplexArray &cd1, double r2, const ComplexArray &cd2, ComplexArray &cd3)
 Does cd3 = r1*cd1 + r2*cd2.
 
void scaled_sum (std::complex< double > c1, const ComplexArray &cd1, std::complex< double > c2, const ComplexArray &cd2, ComplexArray &cd3)
 Does cd3 = c1*cd1 + c2*cd2.
 
void point_mult (ComplexArray &a1, ComplexArray &in2, ComplexArray &out)
 out[i] = a1[i] * in2[i]
 
template<class T >
void zeros (std::complex< T > *u, int n)
 set elements of u as zero which u is 1_d std::complex array
 
ComplexMatrix operator+ (const ComplexMatrix &m1, const ComplexMatrix &m2)
 
ComplexMatrix operator- (const ComplexMatrix &m1, const ComplexMatrix &m2)
 
ComplexMatrix operator* (const ComplexMatrix &m1, const ComplexMatrix &m2)
 
ComplexMatrix operator* (const std::complex< double > &c, const ComplexMatrix &m)
 
ComplexMatrix operator* (const ComplexMatrix &m, const std::complex< double > &c)
 
ComplexMatrix operator* (const double &r, const ComplexMatrix &m)
 
ComplexMatrix operator* (const ComplexMatrix &m, const double &r)
 
std::complex< double > trace (const ComplexMatrix &m)
 
void scale_accumulate (const std::complex< double > &s, const ComplexMatrix &min, ComplexMatrix &mout)
 
void scale_accumulate (const int &nmat, const std::complex< double > &s, ComplexMatrix **min, ComplexMatrix **mout)
 
void scaled_sum (const std::complex< double > &s1, const ComplexMatrix &m1, const std::complex< double > &s2, const ComplexMatrix &m2, ComplexMatrix &mout)
 
void scaled_sum (const int &nmat, const std::complex< double > &s1, ComplexMatrix **m1, const std::complex< double > &s2, ComplexMatrix **m2, ComplexMatrix **mout)
 
double abs2_row (const ComplexMatrix &m, const int ir)
 
double abs2_column (const ComplexMatrix &m, const int ic)
 
double abs2 (const ComplexMatrix &m)
 
double abs2 (const int nmat, ComplexMatrix **m)
 
ComplexMatrix transpose (const ComplexMatrix &m, const bool &conjugate)
 
ComplexMatrix conj (const ComplexMatrix &m)
 
const std::complex< double > ZERO (0.0, 0.0)
 
const std::complex< double > ONE (1.0, 0.0)
 
const std::complex< double > NEG_ONE (-1.0, 0.0)
 
const std::complex< double > IMAG_UNIT (0.0, 1.0)
 
const std::complex< double > NEG_IMAG_UNIT (0.0,-1.0)
 
void IntArrayAlloc ()
 
void Inverse_Matrix_Real (const int dim, const double *in, double *out)
 computes the inverse of a dim*dim real matrix "in" using LAPACK routines "out" contains the inverse on output; "in" is unchanged
 
std::complex< double > set_real_tocomplex (const std::complex< double > &x)
 
std::complex< float > set_real_tocomplex (const std::complex< float > &x)
 
double set_real_tocomplex (const double &x)
 
float set_real_tocomplex (const float &x)
 
std::complex< double > get_conj (const std::complex< double > &x)
 
std::complex< float > get_conj (const std::complex< float > &x)
 
double get_conj (const double &x)
 
float get_conj (const float &x)
 
template<typename FPTYPE >
__inline__ FPTYPE __fact (const int n)
 
__inline__ int __semi_fact (const int n)
 
template void YlmReal::Ylm_Real< float, base_device::DEVICE_CPU > (base_device::DEVICE_CPU *, int, int, const float *, float *)
 
template void YlmReal::Ylm_Real< double, base_device::DEVICE_CPU > (base_device::DEVICE_CPU *, int, int, const double *, double *)
 
void matrixAlloc ()
 
matrix operator+ (const matrix &m1, const matrix &m2)
 
matrix operator- (const matrix &m1, const matrix &m2)
 
matrix operator* (const matrix &m1, const matrix &m2)
 
matrix operator* (const double &s, const matrix &m)
 
matrix operator* (const matrix &m, const double &s)
 
matrix transpose (const matrix &m)
 
double trace_on (const matrix &A, const matrix &B)
 
double mdot (const matrix &A, const matrix &B)
 
Matrix3 operator+ (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "+" for two 3x3 matrices m1 and m2 i.e. m1+m2.
 
Matrix3 operator- (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "-" for two 3x3 matrices m1 and m2, i.e. m1-m2.
 
Matrix3 operator/ (const Matrix3 &m, const double &s)
 Overload operator "/" for a (Matrix3)/(scalar) i.e. m/s.
 
Matrix3 operator* (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "*" for two 3x3 matrices m1 and m2 i.e. m1*m2.
 
Matrix3 operator* (const Matrix3 &m, const double &s)
 Overload operator "*" for (Matrix3)*(scalar) i.e. m*s.
 
Matrix3 operator* (const double &s, const Matrix3 &m)
 Overload operator "*" for (scalar)*(Matrix3) i.e. s*m.
 
bool operator== (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "==" to assert the equality between two 3x3 matrices.
 
bool operator!= (const Matrix3 &m1, const Matrix3 &m2)
 Overload operator "!=" to assert the inequality between two 3x3 matrices.
 
template<typename T >
ModuleBase::Vector3< double > operator* (const Matrix3 &m, const ModuleBase::Vector3< T > &u)
 Overload operator "*" for (Matrix3)*(Vector3)
 
template<typename T >
ModuleBase::Vector3< double > operator* (const ModuleBase::Vector3< T > &u, const Matrix3 &m)
 Overload operator "*" for (Vector3)*(Matrix3)
 
void WARNING_QUIT (const std::string &file, const std::string &description)
 Combine the functions of WARNING and QUIT.
 
void heapAjust (double *r, int *ind, int s, int m)
 
void heapsort (const int n, double *r, int *ind)
 
void hpsort (int n, double *ra, int *ind)
 
void heapAjust (double r[], int ind[], int s, int m)
 
int dcsrch (double &stp, double &f, double &g, double &ftol, double &gtol, double &xtol, char *task, double &stpmin, double &stpmax, int *isave, double *dsave)
 
void dcstep (double &stx, double &fx, double &dx, double &sty, double &fy, double &dy, double &stp, double &fp, double &dp, bool &brackt, double &stpmin, double &stpmax)
 
void realArrayAlloc ()
 
template<class T >
void zeros (T *u, const int n)
 
void WARNING (const std::string &file, const std::string &description)
 Print out warning information in warning.log file.
 
void WARNING_QUIT (const std::string &file, const std::string &description, int ret)
 Combine the functions of WARNING and QUIT.
 
void CHECK_NAME (std::ifstream &ifs, const std::string &name_in, bool quit=true)
 Check the next input from ifs is std::string. This is a global function.
 
void CHECK_INT (std::ifstream &ifs, const int &v, bool quit=true)
 Check the next input from ifs is integer. This is a global function.
 
void CHECK_DOUBLE (std::ifstream &ifs, const double &v, bool quit=true)
 Check the next input from ifs is double. This is a global function.
 
void CHECK_STRING (std::ifstream &ifs, const std::string &v, bool quit=true)
 Check the next input from ifs is std::string. This is a global function.
 
void QUIT (void)
 Close .log files and exit.
 
void QUIT (int ret)
 Close .log files and exit.
 
void CHECK_WARNING_QUIT (const bool error, const std::string &file, const std::string &calculation, const std::string &description)
 Check, if true, WARNING_QUIT.
 
template<typename T_task , typename T_out >
void TASK_DIST_1D (int nworker, int iworker, T_task ntask, T_out &start, T_out &len)
 
template<typename T_task , typename T_out >
void BLOCK_TASK_DIST_1D (int nworker, int iworker, T_task ntask, T_task block_size, T_out &start, T_out &len)
 
void OMP_PARALLEL (const std::function< void(int, int)> &f)
 
void TRY_OMP_PARALLEL (const std::function< void(int, int)> &f)
 
void TITLE (const std::string &class_name, const std::string &function_name, const bool disable)
 
void TITLE (std::ofstream &ofs, const std::string &class_name, const std::string &function_name, const bool disable)
 
template<class T >
Vector3< Toperator+ (const Vector3< T > &u, const Vector3< T > &v)
 Overload "+" for two Vector3.
 
template<class T >
Vector3< Toperator- (const Vector3< T > &u, const Vector3< T > &v)
 Overload "-" for two Vector3.
 
template<class T >
T operator* (const Vector3< T > &u, const Vector3< T > &v)
 Overload "*" to calculate the dot product of two Vector3.
 
template<class T >
Vector3< Toperator* (const T &s, const Vector3< T > &u)
 Overload "*" to calculate (Vector3)*scalar.
 
template<class T >
Vector3< Toperator* (const Vector3< T > &u, const T &s)
 Overload "*" to calculate scalar*(Vector3)
 
template<class T >
Vector3< Toperator/ (const Vector3< T > &u, const T &s)
 Overload "/" to calculate Vector3/scalar.
 
template<class T >
Vector3< Toperator/ (const T &s, const Vector3< T > &u)
 Overload "/" to calculate scalar/Vector3.
 
template<class T >
T dot (const Vector3< T > &u, const Vector3< T > &v)
 Dot productor of two Vector3.
 
template<class T >
Vector3< Toperator^ (const Vector3< T > &u, const Vector3< T > &v)
 Overload "^" for cross product of two Vector3.
 
template<class T >
Vector3< Tcross (const Vector3< T > &u, const Vector3< T > &v)
 Cross product of two Vector3.
 
template<class T >
bool operator< (const Vector3< T > &u, const Vector3< T > &v)
 
template<class T >
bool operator!= (const Vector3< T > &u, const Vector3< T > &v)
 
template<class T >
bool operator== (const Vector3< T > &u, const Vector3< T > &v)
 
void TITLE (const std::string &class_function_name, bool disable)
 
template<class Archive , typename T >
void serialize (Archive &ar, Vector3< T > &v)
 
template<class Archive >
void save (Archive &ar, const matrix &m)
 
template<class Archive >
void load (Archive &ar, matrix &m)
 
template<typename T >
void bcast_data_cereal (T &data, const MPI_Comm &mpi_comm, const int &rank_bcast)
 

Variables

const double PI = 3.14159265358979323846
 
const double PI_HALF = PI / 2.0
 
const double TWO_PI = 2 * PI
 
const double FOUR_PI = 4.0 * 3.14159265358979323846
 
const double INVERSE_FOUR_PI = 1.0/FOUR_PI
 
const double SQRT_INVERSE_FOUR_PI = sqrt(INVERSE_FOUR_PI)
 
const double SQRT2 = 1.41421356237309504880
 
const double K_BOLTZMAN_SI = 1.3806504e-23
 
const double K_BOLTZMAN_AU = 3.1667e-6
 
const double Hartree_to_K = 3.1577464e5
 
const double BOHR_RADIUS_SI = 0.529177e-10
 
const double BOHR_TO_A = 0.5291770
 
const double ELECTRONVOLT_SI = 1.6021892e-19
 
const double ANGSTROM_AU = 1.8897270
 
const double AU_to_FS = 2.418884326505e-2
 
const double e2 = 2.0
 
const double DEGSPIN = 2.0
 
const double Hartree_to_eV = 27.211396
 
const double Ry_to_eV = 13.605698
 
const double NA = 6.02214129e23
 
const double EMASS_SI = 9.1093826e-31
 
const double AU_to_MASS = NA*EMASS_SI*1e3
 
const double HARTREE_SI = 4.35974394e-18
 
const double RYDBERG_SI = HARTREE_SI/2.0
 
const double threshold_wg = 1.0e-10
 
const std::map< std::string, double > CovalentRadius
 
const std::map< std::string, std::string > EleConfig
 
const std::map< std::string, int > MinZval
 
const std::map< std::string, int > IsTransMetal
 
const std::string Name_Angular [5][11]
 

Detailed Description

Tested functions of class matrix:

Tested functions related to class matrix

Function Documentation

◆ __fact()

template<typename FPTYPE >
__inline__ FPTYPE ModuleBase::__fact ( const int  n)

◆ __semi_fact()

__inline__ int ModuleBase::__semi_fact ( const int  n)
Here is the caller graph for this function:

◆ abs2() [1/3]

double ModuleBase::abs2 ( const ComplexArray cd)

Sum of absolute squares of all elements in cd.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abs2() [2/3]

double ModuleBase::abs2 ( const ComplexMatrix m)

◆ abs2() [3/3]

double ModuleBase::abs2 ( const int  nmat,
ComplexMatrix **  m 
)
Here is the call graph for this function:

◆ abs2_column()

double ModuleBase::abs2_column ( const ComplexMatrix m,
const int  ic 
)

◆ abs2_row()

double ModuleBase::abs2_row ( const ComplexMatrix m,
const int  ir 
)

◆ bcast_data_cereal()

template<typename T >
void ModuleBase::bcast_data_cereal ( T data,
const MPI_Comm &  mpi_comm,
const int &  rank_bcast 
)
Here is the caller graph for this function:

◆ BLOCK_TASK_DIST_1D()

template<typename T_task , typename T_out >
void ModuleBase::BLOCK_TASK_DIST_1D ( int  nworker,
int  iworker,
T_task  ntask,
T_task  block_size,
T_out &  start,
T_out &  len 
)
inline
Here is the caller graph for this function:

◆ CHECK_DOUBLE()

void ModuleBase::CHECK_DOUBLE ( std::ifstream &  ifs,
const double &  v,
bool  quit = true 
)

Check the next input from ifs is double. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe double variable for checking
[in]quitWhether call WARNING_QUIT to quit or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CHECK_INT()

void ModuleBase::CHECK_INT ( std::ifstream &  ifs,
const int &  v,
bool  quit = true 
)

Check the next input from ifs is integer. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe int variable for checking
[in]quitWhether call WARNING_QUIT to quit or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CHECK_NAME()

void ModuleBase::CHECK_NAME ( std::ifstream &  ifs,
const std::string &  name_in,
bool  quit = true 
)

Check the next input from ifs is std::string. This is a global function.

Parameters
[in]ifsThe input file stream
[in]name_inThe name for checking
[in]quitWhether call WARNING_QUIT to quit or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CHECK_STRING()

void ModuleBase::CHECK_STRING ( std::ifstream &  ifs,
const std::string &  v,
bool  quit = true 
)

Check the next input from ifs is std::string. This is a global function.

Parameters
[in]ifsThe input file stream
[in]vThe std::string variable for checking
[in]quitWhether call WARNING_QUIT to quit or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CHECK_WARNING_QUIT()

void ModuleBase::CHECK_WARNING_QUIT ( const bool  error,
const std::string &  file,
const std::string &  calculation,
const std::string &  description 
)

Check, if true, WARNING_QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information
Here is the call graph for this function:
Here is the caller graph for this function:

◆ complexArrayxAlloc()

void ModuleBase::complexArrayxAlloc ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ conj()

ComplexMatrix ModuleBase::conj ( const ComplexMatrix m)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cross()

template<class T >
Vector3< T > ModuleBase::cross ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Cross product of two Vector3.

Parameters
u
v
Returns
template <class T>
Note
| i j k | | ux uy uz | | vx vy vz | u.v=(uy*vz-uz*vy)i+(-ux*vz+uz*vx)j+(ux*vy-uy*vx)k

◆ dcsrch()

int ModuleBase::dcsrch ( double &  stp,
double &  f,
double &  g,
double &  ftol,
double &  gtol,
double &  xtol,
char *  task,
double &  stpmin,
double &  stpmax,
int *  isave,
double *  dsave 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dcstep()

void ModuleBase::dcstep ( double &  stx,
double &  fx,
double &  dx,
double &  sty,
double &  fy,
double &  dy,
double &  stp,
double &  fp,
double &  dp,
bool &  brackt,
double &  stpmin,
double &  stpmax 
)
Here is the caller graph for this function:

◆ dot() [1/2]

std::complex< double > ModuleBase::dot ( const ComplexArray cd1,
const ComplexArray cd2 
)

Take "dot-product" of two ComplexArray: sum of cd1(conjugate)[i] * cd2[i].

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dot() [2/2]

template<class T >
T ModuleBase::dot ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Dot productor of two Vector3.

Parameters
u
v
Returns
T
Note
u.v=(ux*vx)+(uy*vy)+(uz*vz)

◆ get_conj() [1/4]

double ModuleBase::get_conj ( const double &  x)
inline

◆ get_conj() [2/4]

float ModuleBase::get_conj ( const float &  x)
inline

◆ get_conj() [3/4]

std::complex< double > ModuleBase::get_conj ( const std::complex< double > &  x)
inline

◆ get_conj() [4/4]

std::complex< float > ModuleBase::get_conj ( const std::complex< float > &  x)
inline

◆ heapAjust() [1/2]

void ModuleBase::heapAjust ( double *  r,
int *  ind,
int  s,
int  m 
)
Here is the caller graph for this function:

◆ heapAjust() [2/2]

void ModuleBase::heapAjust ( double  r[],
int  ind[],
int  s,
int  m 
)

◆ heapsort()

void ModuleBase::heapsort ( const int  n,
double *  r,
int *  ind 
)
Examples
/home/runner/work/abacus-develop/abacus-develop/source/source_basis/module_pw/pw_distributeg_method1.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hpsort()

void ModuleBase::hpsort ( int  n,
double *  ra,
int *  ind 
)
Here is the caller graph for this function:

◆ IMAG_UNIT()

const std::complex< double > ModuleBase::IMAG_UNIT ( 0.  0,
1.  0 
)

◆ IntArrayAlloc()

void ModuleBase::IntArrayAlloc ( )
Here is the caller graph for this function:

◆ Inverse_Matrix_Real()

void ModuleBase::Inverse_Matrix_Real ( const int  dim,
const double *  in,
double *  out 
)

computes the inverse of a dim*dim real matrix "in" using LAPACK routines "out" contains the inverse on output; "in" is unchanged

Parameters
dim[in] dimension of the matrix
in[in] input matrix
out[out] output matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

template<class Archive >
void ModuleBase::load ( Archive &  ar,
matrix m 
)
Here is the call graph for this function:

◆ matrixAlloc()

void ModuleBase::matrixAlloc ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mdot()

double ModuleBase::mdot ( const matrix A,
const matrix B 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NEG_IMAG_UNIT()

const std::complex< double > ModuleBase::NEG_IMAG_UNIT ( 0.  0,
-1.  0 
)
Here is the caller graph for this function:

◆ NEG_ONE()

const std::complex< double > ModuleBase::NEG_ONE ( -1.  0,
0.  0 
)

◆ OMP_PARALLEL()

void ModuleBase::OMP_PARALLEL ( const std::function< void(int, int)> &  f)
inline
Here is the caller graph for this function:

◆ ONE()

const std::complex< double > ModuleBase::ONE ( 1.  0,
0.  0 
)
Here is the caller graph for this function:

◆ operator!=() [1/2]

bool ModuleBase::operator!= ( const Matrix3 m1,
const Matrix3 m2 
)

Overload operator "!=" to assert the inequality between two 3x3 matrices.

Parameters
m1
m2
Returns
true: if two matrices are inequal
false: if they equal

= defined in terms of operator ==

◆ operator!=() [2/2]

template<class T >
bool ModuleBase::operator!= ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

◆ operator*() [1/18]

ComplexMatrix ModuleBase::operator* ( const ComplexMatrix m,
const double &  r 
)

◆ operator*() [2/18]

ComplexMatrix ModuleBase::operator* ( const ComplexMatrix m,
const std::complex< double > &  c 
)

◆ operator*() [3/18]

ComplexMatrix ModuleBase::operator* ( const ComplexMatrix m1,
const ComplexMatrix m2 
)
Here is the call graph for this function:

◆ operator*() [4/18]

ComplexMatrix ModuleBase::operator* ( const double &  r,
const ComplexMatrix m 
)

◆ operator*() [5/18]

matrix ModuleBase::operator* ( const double &  s,
const matrix m 
)

◆ operator*() [6/18]

Matrix3 ModuleBase::operator* ( const double &  s,
const Matrix3 m 
)

Overload operator "*" for (scalar)*(Matrix3) i.e. s*m.

Parameters
sThe scalar
mThe 3x3 matrix
Returns
Matrix3

◆ operator*() [7/18]

ComplexArray ModuleBase::operator* ( const double  r,
const ComplexArray cd 
)

Scale a ComplexArray cd by real r.

Here is the call graph for this function:

◆ operator*() [8/18]

matrix ModuleBase::operator* ( const matrix m,
const double &  s 
)

◆ operator*() [9/18]

matrix ModuleBase::operator* ( const matrix m1,
const matrix m2 
)
Here is the call graph for this function:

◆ operator*() [10/18]

Matrix3 ModuleBase::operator* ( const Matrix3 m,
const double &  s 
)

Overload operator "*" for (Matrix3)*(scalar) i.e. m*s.

Parameters
mThe 3x3 matrix
sThe scalar
Returns
Matrix3

◆ operator*() [11/18]

template<typename T >
ModuleBase::Vector3< double > ModuleBase::operator* ( const Matrix3 m,
const ModuleBase::Vector3< T > &  u 
)

Overload operator "*" for (Matrix3)*(Vector3)

Template Parameters
T
Parameters
mThe 3x3 matrix
uThe vector with 3 elements
Returns
ModuleBase::Vector3<double>
Author
Peize Lin

◆ operator*() [12/18]

Matrix3 ModuleBase::operator* ( const Matrix3 m1,
const Matrix3 m2 
)

Overload operator "*" for two 3x3 matrices m1 and m2 i.e. m1*m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator*() [13/18]

template<typename T >
ModuleBase::Vector3< double > ModuleBase::operator* ( const ModuleBase::Vector3< T > &  u,
const Matrix3 m 
)

Overload operator "*" for (Vector3)*(Matrix3)

Template Parameters
T
Parameters
uThe vector with 3 elements
mThe 3x3 matrix
Returns
ModuleBase::Vector3<double>

◆ operator*() [14/18]

ComplexMatrix ModuleBase::operator* ( const std::complex< double > &  c,
const ComplexMatrix m 
)

◆ operator*() [15/18]

ComplexArray ModuleBase::operator* ( const std::complex< double >  c,
const ComplexArray cd 
)

Scale a ComplexArray cd by std::complex number c.

Here is the call graph for this function:

◆ operator*() [16/18]

template<class T >
Vector3< T > ModuleBase::operator* ( const T s,
const Vector3< T > &  u 
)
inline

Overload "*" to calculate (Vector3)*scalar.

Parameters
[in]s
[in]u
Returns
Vector3<T>

◆ operator*() [17/18]

template<class T >
Vector3< T > ModuleBase::operator* ( const Vector3< T > &  u,
const T s 
)
inline

Overload "*" to calculate scalar*(Vector3)

Parameters
u
s
Returns
Vector3<T>

◆ operator*() [18/18]

template<class T >
T ModuleBase::operator* ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Overload "*" to calculate the dot product of two Vector3.

Parameters
u
v
Returns
template <class T>

◆ operator+() [1/4]

ComplexMatrix ModuleBase::operator+ ( const ComplexMatrix m1,
const ComplexMatrix m2 
)

◆ operator+() [2/4]

matrix ModuleBase::operator+ ( const matrix m1,
const matrix m2 
)

◆ operator+() [3/4]

Matrix3 ModuleBase::operator+ ( const Matrix3 m1,
const Matrix3 m2 
)

Overload operator "+" for two 3x3 matrices m1 and m2 i.e. m1+m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator+() [4/4]

template<class T >
Vector3< T > ModuleBase::operator+ ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Overload "+" for two Vector3.

Parameters
[in]u
[in]v
Returns
Vector3<T>

◆ operator-() [1/4]

ComplexMatrix ModuleBase::operator- ( const ComplexMatrix m1,
const ComplexMatrix m2 
)

◆ operator-() [2/4]

matrix ModuleBase::operator- ( const matrix m1,
const matrix m2 
)

◆ operator-() [3/4]

Matrix3 ModuleBase::operator- ( const Matrix3 m1,
const Matrix3 m2 
)

Overload operator "-" for two 3x3 matrices m1 and m2, i.e. m1-m2.

Parameters
m1
m2
Returns
Matrix3

◆ operator-() [4/4]

template<class T >
Vector3< T > ModuleBase::operator- ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Overload "-" for two Vector3.

Parameters
[in]u
[in]v
Returns
Vector3<T>

◆ operator/() [1/3]

Matrix3 ModuleBase::operator/ ( const Matrix3 m,
const double &  s 
)

Overload operator "/" for a (Matrix3)/(scalar) i.e. m/s.

Parameters
mThe 3x3 matrix
sThe scalar
Returns
Matrix3

◆ operator/() [2/3]

template<class T >
Vector3< T > ModuleBase::operator/ ( const T s,
const Vector3< T > &  u 
)
inline

Overload "/" to calculate scalar/Vector3.

Template Parameters
T
Parameters
s
u
Returns
Vector3<T>

◆ operator/() [3/3]

template<class T >
Vector3< T > ModuleBase::operator/ ( const Vector3< T > &  u,
const T s 
)
inline

Overload "/" to calculate Vector3/scalar.

Template Parameters
T
Parameters
u
s
Returns
Vector3<T>

◆ operator<()

template<class T >
bool ModuleBase::operator< ( const Vector3< T > &  u,
const Vector3< T > &  v 
)

◆ operator==() [1/2]

bool ModuleBase::operator== ( const Matrix3 m1,
const Matrix3 m2 
)

Overload operator "==" to assert the equality between two 3x3 matrices.

Parameters
m1
m2
Returns
true: if two matrices equal each other
false: if they do not equal

◆ operator==() [2/2]

template<class T >
bool ModuleBase::operator== ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

◆ operator^()

template<class T >
Vector3< T > ModuleBase::operator^ ( const Vector3< T > &  u,
const Vector3< T > &  v 
)
inline

Overload "^" for cross product of two Vector3.

Parameters
u
v
Returns
template <class T>
Note
| i j k | | ux uy uz | | vx vy vz | u.v=(uy*vz-uz*vy)i+(-ux*vz+uz*vx)j+(ux*vy-uy*vx)k

◆ point_mult()

void ModuleBase::point_mult ( ComplexArray in1,
ComplexArray in2,
ComplexArray out 
)

out[i] = a1[i] * in2[i]

Here is the call graph for this function:

◆ QUIT() [1/2]

void ModuleBase::QUIT ( int  ret)

Close .log files and exit.

Here is the call graph for this function:

◆ QUIT() [2/2]

void ModuleBase::QUIT ( )

Close .log files and exit.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ realArrayAlloc()

void ModuleBase::realArrayAlloc ( )
Here is the caller graph for this function:

◆ save()

template<class Archive >
void ModuleBase::save ( Archive &  ar,
const matrix m 
)

◆ scale_accumulate() [1/4]

void ModuleBase::scale_accumulate ( const int &  nmat,
const std::complex< double > &  s,
ComplexMatrix **  min,
ComplexMatrix **  mout 
)
Here is the call graph for this function:

◆ scale_accumulate() [2/4]

void ModuleBase::scale_accumulate ( const std::complex< double > &  s,
const ComplexMatrix min,
ComplexMatrix mout 
)

◆ scale_accumulate() [3/4]

void ModuleBase::scale_accumulate ( double  r,
const ComplexArray cd1,
ComplexArray cd2 
)

Does cd2 += r * cd1.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale_accumulate() [4/4]

void ModuleBase::scale_accumulate ( const std::complex< double >  c,
const ComplexArray cd1,
ComplexArray cd2 
)

Does cd2 += c * cd1.

Here is the call graph for this function:

◆ scaled_sum() [1/4]

void ModuleBase::scaled_sum ( const int &  nmat,
const std::complex< double > &  s1,
ComplexMatrix **  m1,
const std::complex< double > &  s2,
ComplexMatrix **  m2,
ComplexMatrix **  mout 
)
Here is the call graph for this function:

◆ scaled_sum() [2/4]

void ModuleBase::scaled_sum ( const std::complex< double > &  s1,
const ComplexMatrix m1,
const std::complex< double > &  s2,
const ComplexMatrix m2,
ComplexMatrix mout 
)

◆ scaled_sum() [3/4]

void ModuleBase::scaled_sum ( double  r1,
const ComplexArray cd1,
double  r2,
const ComplexArray cd2,
ComplexArray cd3 
)

Does cd3 = r1*cd1 + r2*cd2.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaled_sum() [4/4]

void ModuleBase::scaled_sum ( std::complex< double >  c1,
const ComplexArray cd1,
std::complex< double >  c2,
const ComplexArray cd2,
ComplexArray cd3 
)

Does cd3 = c1*cd1 + c2*cd2.

Here is the call graph for this function:

◆ serialize()

template<class Archive , typename T >
void ModuleBase::serialize ( Archive &  ar,
Vector3< T > &  v 
)

◆ set_real_tocomplex() [1/4]

double ModuleBase::set_real_tocomplex ( const double &  x)
inline

◆ set_real_tocomplex() [2/4]

float ModuleBase::set_real_tocomplex ( const float &  x)
inline

◆ set_real_tocomplex() [3/4]

std::complex< double > ModuleBase::set_real_tocomplex ( const std::complex< double > &  x)
inline

◆ set_real_tocomplex() [4/4]

std::complex< float > ModuleBase::set_real_tocomplex ( const std::complex< float > &  x)
inline

◆ TASK_DIST_1D()

template<typename T_task , typename T_out >
void ModuleBase::TASK_DIST_1D ( int  nworker,
int  iworker,
T_task  ntask,
T_out &  start,
T_out &  len 
)
inline
Here is the caller graph for this function:

◆ TITLE() [1/3]

void ModuleBase::TITLE ( const std::string &  class_function_name,
bool  disable 
)
Here is the call graph for this function:

◆ TITLE() [2/3]

void ModuleBase::TITLE ( const std::string &  class_name,
const std::string &  function_name = "",
const bool  disable = true 
)
Here is the call graph for this function:

◆ TITLE() [3/3]

void ModuleBase::TITLE ( std::ofstream &  ofs,
const std::string &  class_name,
const std::string &  function_name,
const bool  disable 
)
Here is the call graph for this function:

◆ trace()

std::complex< double > ModuleBase::trace ( const ComplexMatrix m)

◆ trace_on()

double ModuleBase::trace_on ( const matrix A,
const matrix B 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transpose() [1/2]

ComplexMatrix ModuleBase::transpose ( const ComplexMatrix m,
const bool &  conjugate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transpose() [2/2]

matrix ModuleBase::transpose ( const matrix m)
Here is the call graph for this function:

◆ TRY_OMP_PARALLEL()

void ModuleBase::TRY_OMP_PARALLEL ( const std::function< void(int, int)> &  f)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WARNING()

void ModuleBase::WARNING ( const std::string &  file,
const std::string &  description 
)

Print out warning information in warning.log file.

Parameters
fileThe file where warning happens
descriptionThe warning information
Here is the caller graph for this function:

◆ WARNING_QUIT() [1/2]

void ModuleBase::WARNING_QUIT ( const std::string &  file,
const std::string &  description 
)

Combine the functions of WARNING and QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information

◆ WARNING_QUIT() [2/2]

void ModuleBase::WARNING_QUIT ( const std::string &  file,
const std::string &  description,
int  ret 
)

Combine the functions of WARNING and QUIT.

Parameters
fileThe file where warning happens
descriptionThe warning information

◆ YlmReal::Ylm_Real< double, base_device::DEVICE_CPU >()

template void ModuleBase::YlmReal::Ylm_Real< double, base_device::DEVICE_CPU > ( base_device::DEVICE_CPU *  ,
int  ,
int  ,
const double *  ,
double *   
)

◆ YlmReal::Ylm_Real< float, base_device::DEVICE_CPU >()

template void ModuleBase::YlmReal::Ylm_Real< float, base_device::DEVICE_CPU > ( base_device::DEVICE_CPU *  ,
int  ,
int  ,
const float *  ,
float *   
)

◆ ZERO()

const std::complex< double > ModuleBase::ZERO ( 0.  0,
0.  0 
)
Here is the caller graph for this function:

◆ zeros() [1/2]

template<class T >
void ModuleBase::zeros ( std::complex< T > *  u,
int  n 
)

set elements of u as zero which u is 1_d std::complex array

Here is the caller graph for this function:

◆ zeros() [2/2]

template<class T >
void ModuleBase::zeros ( T u,
const int  n 
)

Variable Documentation

◆ ANGSTROM_AU

const double ModuleBase::ANGSTROM_AU = 1.8897270

◆ AU_to_FS

const double ModuleBase::AU_to_FS = 2.418884326505e-2

◆ AU_to_MASS

const double ModuleBase::AU_to_MASS = NA*EMASS_SI*1e3

◆ BOHR_RADIUS_SI

const double ModuleBase::BOHR_RADIUS_SI = 0.529177e-10

◆ BOHR_TO_A

const double ModuleBase::BOHR_TO_A = 0.5291770

◆ CovalentRadius

const std::map<std::string, double> ModuleBase::CovalentRadius

◆ DEGSPIN

const double ModuleBase::DEGSPIN = 2.0

◆ e2

const double ModuleBase::e2 = 2.0

◆ EleConfig

const std::map<std::string, std::string> ModuleBase::EleConfig

◆ ELECTRONVOLT_SI

const double ModuleBase::ELECTRONVOLT_SI = 1.6021892e-19

◆ EMASS_SI

const double ModuleBase::EMASS_SI = 9.1093826e-31

◆ FOUR_PI

const double ModuleBase::FOUR_PI = 4.0 * 3.14159265358979323846

◆ HARTREE_SI

const double ModuleBase::HARTREE_SI = 4.35974394e-18

◆ Hartree_to_eV

const double ModuleBase::Hartree_to_eV = 27.211396

◆ Hartree_to_K

const double ModuleBase::Hartree_to_K = 3.1577464e5

◆ INVERSE_FOUR_PI

const double ModuleBase::INVERSE_FOUR_PI = 1.0/FOUR_PI

◆ IsTransMetal

const std::map<std::string, int> ModuleBase::IsTransMetal

◆ K_BOLTZMAN_AU

const double ModuleBase::K_BOLTZMAN_AU = 3.1667e-6

◆ K_BOLTZMAN_SI

const double ModuleBase::K_BOLTZMAN_SI = 1.3806504e-23

◆ MinZval

const std::map<std::string, int> ModuleBase::MinZval

◆ NA

const double ModuleBase::NA = 6.02214129e23

◆ Name_Angular

const std::string ModuleBase::Name_Angular[5][11]
Initial value:
=
{
{"s"},
{"pz", "px", "py"},
{"dz^2", "dxz", "dyz", "dx^2-y^2", "dxy"},
{"fz^3", "fxz^2", "fyz^2", "fzx^2-zy^2", "fxyz", "fx^3-3*xy^2", "f3yx^2-y^3"},
{"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g9"}
}

◆ PI

const double ModuleBase::PI = 3.14159265358979323846

◆ PI_HALF

const double ModuleBase::PI_HALF = PI / 2.0

◆ Ry_to_eV

const double ModuleBase::Ry_to_eV = 13.605698

◆ RYDBERG_SI

const double ModuleBase::RYDBERG_SI = HARTREE_SI/2.0

◆ SQRT2

const double ModuleBase::SQRT2 = 1.41421356237309504880

◆ SQRT_INVERSE_FOUR_PI

const double ModuleBase::SQRT_INVERSE_FOUR_PI = sqrt(INVERSE_FOUR_PI)

◆ threshold_wg

const double ModuleBase::threshold_wg = 1.0e-10

◆ TWO_PI

const double ModuleBase::TWO_PI = 2 * PI