ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ModuleBase::ComplexArray Class Reference

A basic type of data for complex array. More...

#include <complexarray.h>

Collaboration diagram for ModuleBase::ComplexArray:

Public Member Functions

 ComplexArray (const int bnd1=0, const int bnd2=1, const int bnd3=1, const int bnd4=1)
 
 ~ComplexArray ()
 
void freemem ()
 
void create (const int bnd1=0, const int bnd2=1, const int bnd3=1, const int bnd4=1)
 
 ComplexArray (const ComplexArray &cd)
 
 ComplexArray (ComplexArray &&cd)
 
ComplexArrayoperator= (ComplexArray &&cd)
 
ComplexArrayoperator= (const ComplexArray &cd)
 
void operator= (std::complex< double > c)
 Assignment of scalar: all entries set to c.
 
ComplexArray operator+ (const ComplexArray &cd)
 Add two ComplexArray.
 
void operator+= (const ComplexArray &cd)
 Accumulate sum of ComplexArray.
 
ComplexArray operator- (const ComplexArray &cd)
 Subtract two ComplexArray.
 
void operator-= (const ComplexArray &cd)
 Accumulate difference of arrays.
 
ComplexArray operator* (const double r)
 Scale a ComplexArray by real r.
 
ComplexArray operator* (const std::complex< double > c)
 Scale a ComplexArray by a std::complex number c.
 
void operator*= (const double r)
 Scale a ComplexArray by real number in place.
 
void operator*= (const std::complex< double > c)
 Scale a ComplexArray by std::complex c in place.
 
void operator*= (const ComplexArray &cd)
 accumulate pointwise multiply
 
bool operator== (const ComplexArray &cd2) const
 Judge if two ComplexArray is equal.
 
bool operator!= (const ComplexArray &cd2) const
 Judge if two ComplexArray is not equal.
 
std::complex< double > & operator() (const int ind1=0, const int ind2=0, const int ind3=0, const int ind4=0)
 overloaded subscript operator for non-const std::complex Array const reference return creates an lvakue
 
const std::complex< double > & operator() (const int ind1=0, const int ind2=0, const int ind3=0, const int ind4=0) const
 overloaded subscript operator for const std::complex Array const reference return creates an cvakue
 
void zero_out (void)
 set all elements to be {0.0,0.0}
 
void negate (void)
 Negates all the entries in the array.
 
void randomize (void)
 set all elements to a random number whose real/image is between [-0.5,0.5).
 
int getBound1 () const
 
int getBound2 () const
 
int getBound3 () const
 
int getBound4 () const
 
int getSize () const
 

Public Attributes

std::complex< double > * ptr =nullptr
 

Private Member Functions

void init (const int size)
 

Private Attributes

int bound1
 
int bound2
 
int bound3
 
int bound4
 

Detailed Description

A basic type of data for complex array.

Constructor & Destructor Documentation

◆ ComplexArray() [1/3]

ModuleBase::ComplexArray::ComplexArray ( const int  bnd1 = 0,
const int  bnd2 = 1,
const int  bnd3 = 1,
const int  bnd4 = 1 
)
Here is the call graph for this function:

◆ ~ComplexArray()

ModuleBase::ComplexArray::~ComplexArray ( )
Here is the call graph for this function:

◆ ComplexArray() [2/3]

ModuleBase::ComplexArray::ComplexArray ( const ComplexArray cd)
Here is the call graph for this function:

◆ ComplexArray() [3/3]

ModuleBase::ComplexArray::ComplexArray ( ComplexArray &&  cd)

Member Function Documentation

◆ create()

void ModuleBase::ComplexArray::create ( const int  bnd1 = 0,
const int  bnd2 = 1,
const int  bnd3 = 1,
const int  bnd4 = 1 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freemem()

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

◆ getBound1()

int ModuleBase::ComplexArray::getBound1 ( ) const
inline
Here is the caller graph for this function:

◆ getBound2()

int ModuleBase::ComplexArray::getBound2 ( ) const
inline
Here is the caller graph for this function:

◆ getBound3()

int ModuleBase::ComplexArray::getBound3 ( ) const
inline
Here is the caller graph for this function:

◆ getBound4()

int ModuleBase::ComplexArray::getBound4 ( ) const
inline
Here is the caller graph for this function:

◆ getSize()

int ModuleBase::ComplexArray::getSize ( ) const
inline
Here is the caller graph for this function:

◆ init()

void ModuleBase::ComplexArray::init ( const int  size)
private
Here is the caller graph for this function:

◆ negate()

void ModuleBase::ComplexArray::negate ( void  )

Negates all the entries in the array.

Here is the call graph for this function:

◆ operator!=()

bool ModuleBase::ComplexArray::operator!= ( const ComplexArray cd2) const

Judge if two ComplexArray is not equal.

Here is the call graph for this function:

◆ operator()() [1/2]

std::complex< double > & ModuleBase::ComplexArray::operator() ( const int  ind1 = 0,
const int  ind2 = 0,
const int  ind3 = 0,
const int  ind4 = 0 
)
inline

overloaded subscript operator for non-const std::complex Array const reference return creates an lvakue

◆ operator()() [2/2]

const std::complex< double > & ModuleBase::ComplexArray::operator() ( const int  ind1 = 0,
const int  ind2 = 0,
const int  ind3 = 0,
const int  ind4 = 0 
) const
inline

overloaded subscript operator for const std::complex Array const reference return creates an cvakue

◆ operator*() [1/2]

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

Scale a ComplexArray by real r.

Here is the call graph for this function:

◆ operator*() [2/2]

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

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

Here is the call graph for this function:

◆ operator*=() [1/3]

void ModuleBase::ComplexArray::operator*= ( const ComplexArray cd)

accumulate pointwise multiply

Here is the call graph for this function:

◆ operator*=() [2/3]

void ModuleBase::ComplexArray::operator*= ( const double  r)

Scale a ComplexArray by real number in place.

Here is the call graph for this function:

◆ operator*=() [3/3]

void ModuleBase::ComplexArray::operator*= ( const std::complex< double >  c)

Scale a ComplexArray by std::complex c in place.

Here is the call graph for this function:

◆ operator+()

ComplexArray ModuleBase::ComplexArray::operator+ ( const ComplexArray cd)

Add two ComplexArray.

Here is the call graph for this function:

◆ operator+=()

void ModuleBase::ComplexArray::operator+= ( const ComplexArray cd)

Accumulate sum of ComplexArray.

Here is the call graph for this function:

◆ operator-()

ComplexArray ModuleBase::ComplexArray::operator- ( const ComplexArray cd)

Subtract two ComplexArray.

Here is the call graph for this function:

◆ operator-=()

void ModuleBase::ComplexArray::operator-= ( const ComplexArray cd)

Accumulate difference of arrays.

Here is the call graph for this function:

◆ operator=() [1/3]

ComplexArray & ModuleBase::ComplexArray::operator= ( ComplexArray &&  cd)

◆ operator=() [2/3]

ComplexArray & ModuleBase::ComplexArray::operator= ( const ComplexArray cd)
Here is the call graph for this function:

◆ operator=() [3/3]

void ModuleBase::ComplexArray::operator= ( std::complex< double >  c)

Assignment of scalar: all entries set to c.

Here is the call graph for this function:

◆ operator==()

bool ModuleBase::ComplexArray::operator== ( const ComplexArray cd2) const

Judge if two ComplexArray is equal.

Here is the call graph for this function:

◆ randomize()

void ModuleBase::ComplexArray::randomize ( void  )

set all elements to a random number whose real/image is between [-0.5,0.5).

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

◆ zero_out()

void ModuleBase::ComplexArray::zero_out ( void  )

set all elements to be {0.0,0.0}

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

Member Data Documentation

◆ bound1

int ModuleBase::ComplexArray::bound1
private

◆ bound2

int ModuleBase::ComplexArray::bound2
private

◆ bound3

int ModuleBase::ComplexArray::bound3
private

◆ bound4

int ModuleBase::ComplexArray::bound4
private

◆ ptr

std::complex<double>* ModuleBase::ComplexArray::ptr =nullptr

The documentation for this class was generated from the following files: