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

Plain mixing : rho_new = rho_in + mixing_beta * (rho_out - rho_in) More...

#include <plain_mixing.h>

Inheritance diagram for Base_Mixing::Plain_Mixing:
Collaboration diagram for Base_Mixing::Plain_Mixing:

Public Member Functions

 Plain_Mixing ()
 
 Plain_Mixing (const double &mixing_beta)
 
virtual ~Plain_Mixing () override
 
virtual void reset () override
 reset mixing
 
virtual void push_data (Mixing_Data &mdata, const double *data_in, const double *data_out, std::function< void(double *)> screen, std::function< void(double *, const double *, const double *)> mix, const bool &need_calcoef) override
 
virtual void push_data (Mixing_Data &mdata, const std::complex< double > *data_in, const std::complex< double > *data_out, std::function< void(std::complex< double > *)> screen, std::function< void(std::complex< double > *, const std::complex< double > *, const std::complex< double > *)> mix, const bool &need_calcoef) override
 
virtual void cal_coef (const Mixing_Data &mdata, std::function< double(double *, double *)> inner_product) override
 calculate coeficients for mixing
 
virtual void cal_coef (const Mixing_Data &mdata, std::function< double(std::complex< double > *, std::complex< double > *)> inner_product) override
 
void plain_mix (double *data_new, const double *data_in, const double *data_out, const int &length, std::function< void(double *)> screen)
 Simple plain mixing data_new = data_in + mixing_beta * (data_out - data_in)
 
void plain_mix (std::complex< double > *data_new, const std::complex< double > *data_in, const std::complex< double > *data_out, const int &length, std::function< void(std::complex< double > *)> screen)
 
virtual void push_data (Mixing_Data &mdata, const double *data_in, const double *data_out, std::function< void(double *)> screen, std::function< void(double *, const double *, const double *)> mix, const bool &need_calcoef)=0
 
virtual void push_data (Mixing_Data &mdata, const std::complex< double > *data_in, const std::complex< double > *data_out, std::function< void(std::complex< double > *)> screen, std::function< void(std::complex< double > *, const std::complex< double > *, const std::complex< double > *)> mix, const bool &need_calcoef)=0
 
virtual void push_data (Mixing_Data &mdata, const double *data_in, const double *data_out, std::function< void(double *)> screen, const bool &need_calcoef)
 
virtual void push_data (Mixing_Data &mdata, const std::complex< double > *data_in, const std::complex< double > *data_out, std::function< void(std::complex< double > *)> screen, const bool &need_calcoef)
 
- Public Member Functions inherited from Base_Mixing::Mixing
 Mixing ()
 
virtual ~Mixing ()
 
virtual void init_mixing_data (Mixing_Data &mdata, const int &length, const size_t &type_size) const
 init mixing data
 
void mix_data (const Mixing_Data &mdata, double *data_mix)
 calculate the mixing data
 
void mix_data (const Mixing_Data &mdata, std::complex< double > *data_mix)
 

Private Member Functions

template<class FPTYPE >
void tem_push_data (Mixing_Data &mdata, const FPTYPE *data_in, const FPTYPE *data_out, std::function< void(FPTYPE *)> screen, std::function< void(FPTYPE *, const FPTYPE *, const FPTYPE *)> mix, const bool &need_calcoef)
 
template<class FPTYPE >
void simple_mix (FPTYPE *data_new, const FPTYPE *data_in, const FPTYPE *data_out, const int &length, std::function< void(FPTYPE *)> screen)
 Simple plain mixing data_new = data_in + mixing_beta * (data_out - data_in)
 

Additional Inherited Members

- Public Attributes inherited from Base_Mixing::Mixing
double mixing_beta = 0.7
 
std::vector< double > coef
 
int data_ndim = 1
 

Detailed Description

Plain mixing : rho_new = rho_in + mixing_beta * (rho_out - rho_in)

Constructor & Destructor Documentation

◆ Plain_Mixing() [1/2]

Base_Mixing::Plain_Mixing::Plain_Mixing ( )
inline

◆ Plain_Mixing() [2/2]

Base_Mixing::Plain_Mixing::Plain_Mixing ( const double &  mixing_beta)
inline

◆ ~Plain_Mixing()

virtual Base_Mixing::Plain_Mixing::~Plain_Mixing ( )
inlineoverridevirtual

Member Function Documentation

◆ cal_coef() [1/2]

virtual void Base_Mixing::Plain_Mixing::cal_coef ( const Mixing_Data mdata,
std::function< double(double *, double *)>  inner_product 
)
inlineoverridevirtual

calculate coeficients for mixing

Parameters
mdataMixing_Data
inner_productpointer to the inner dot function

Implements Base_Mixing::Mixing.

◆ cal_coef() [2/2]

virtual void Base_Mixing::Plain_Mixing::cal_coef ( const Mixing_Data mdata,
std::function< double(std::complex< double > *, std::complex< double > *)>  inner_product 
)
inlineoverridevirtual

Implements Base_Mixing::Mixing.

◆ plain_mix() [1/2]

void Base_Mixing::Plain_Mixing::plain_mix ( double *  data_new,
const double *  data_in,
const double *  data_out,
const int &  length,
std::function< void(double *)>  screen 
)
inline

Simple plain mixing data_new = data_in + mixing_beta * (data_out - data_in)

Parameters
data_newcan be the same as data_in or data_out
Here is the call graph for this function:
Here is the caller graph for this function:

◆ plain_mix() [2/2]

void Base_Mixing::Plain_Mixing::plain_mix ( std::complex< double > *  data_new,
const std::complex< double > *  data_in,
const std::complex< double > *  data_out,
const int &  length,
std::function< void(std::complex< double > *)>  screen 
)
inline
Here is the call graph for this function:

◆ push_data() [1/6]

void Base_Mixing::Mixing::push_data ( Mixing_Data mdata,
const double *  data_in,
const double *  data_out,
std::function< void(double *)>  screen,
const bool &  need_calcoef 
)
virtual
Parameters
mdatastore information of this iterative step
data_inx_in
data_outx_out = f(x_in)
screenpointer to the screen function for Ker-Ker mixing
need_calcoefwhether need to calculate the coef

Reimplemented from Base_Mixing::Mixing.

◆ push_data() [2/6]

virtual void Base_Mixing::Plain_Mixing::push_data ( Mixing_Data mdata,
const double *  data_in,
const double *  data_out,
std::function< void(double *)>  screen,
std::function< void(double *, const double *, const double *)>  mix,
const bool &  need_calcoef 
)
inlineoverridevirtual
Parameters
mdatastore information of this iterative step
data_inx_in
data_outx_out = f(x_in)
screenpointer to the screen function for Ker-Ker mixing
mix(double* out, const double* in, const double* residual) calculate 'out' with 'in' and residual
need_calcoefwhether need to calculate the coef

Implements Base_Mixing::Mixing.

Here is the call graph for this function:

◆ push_data() [3/6]

virtual void Base_Mixing::Mixing::push_data ( Mixing_Data mdata,
const double *  data_in,
const double *  data_out,
std::function< void(double *)>  screen,
std::function< void(double *, const double *, const double *)>  mix,
const bool &  need_calcoef 
)
virtual
Parameters
mdatastore information of this iterative step
data_inx_in
data_outx_out = f(x_in)
screenpointer to the screen function for Ker-Ker mixing
mix(double* out, const double* in, const double* residual) calculate 'out' with 'in' and residual
need_calcoefwhether need to calculate the coef

Implements Base_Mixing::Mixing.

◆ push_data() [4/6]

void Base_Mixing::Mixing::push_data ( Mixing_Data mdata,
const std::complex< double > *  data_in,
const std::complex< double > *  data_out,
std::function< void(std::complex< double > *)>  screen,
const bool &  need_calcoef 
)
virtual

Reimplemented from Base_Mixing::Mixing.

◆ push_data() [5/6]

virtual void Base_Mixing::Plain_Mixing::push_data ( Mixing_Data mdata,
const std::complex< double > *  data_in,
const std::complex< double > *  data_out,
std::function< void(std::complex< double > *)>  screen,
std::function< void(std::complex< double > *, const std::complex< double > *, const std::complex< double > *)>  mix,
const bool &  need_calcoef 
)
inlineoverridevirtual

Implements Base_Mixing::Mixing.

Here is the call graph for this function:

◆ push_data() [6/6]

virtual void Base_Mixing::Mixing::push_data ( Mixing_Data mdata,
const std::complex< double > *  data_in,
const std::complex< double > *  data_out,
std::function< void(std::complex< double > *)>  screen,
std::function< void(std::complex< double > *, const std::complex< double > *, const std::complex< double > *)>  mix,
const bool &  need_calcoef 
)
virtual

Implements Base_Mixing::Mixing.

◆ reset()

virtual void Base_Mixing::Plain_Mixing::reset ( )
inlineoverridevirtual

reset mixing

Implements Base_Mixing::Mixing.

◆ simple_mix()

template<class FPTYPE >
void Base_Mixing::Plain_Mixing::simple_mix ( FPTYPE *  data_new,
const FPTYPE *  data_in,
const FPTYPE *  data_out,
const int &  length,
std::function< void(FPTYPE *)>  screen 
)
private

Simple plain mixing data_new = data_in + mixing_beta * (data_out - data_in)

Parameters
data_newcan be the same as data_in or data_out
Here is the caller graph for this function:

◆ tem_push_data()

template<class FPTYPE >
void Base_Mixing::Plain_Mixing::tem_push_data ( Mixing_Data mdata,
const FPTYPE *  data_in,
const FPTYPE *  data_out,
std::function< void(FPTYPE *)>  screen,
std::function< void(FPTYPE *, const FPTYPE *, const FPTYPE *)>  mix,
const bool &  need_calcoef 
)
private
Parameters
mdatastore information of this iterative step
data_inx_in
data_outx_out = f(x_in)
screenpointer to the screen function for Ker-Ker mixing
mix(double* out, const double* in, const double* residual) calculate 'out' with 'in' and residual
need_calcoefwhether need to calculate the coef
Here is the call graph for this function:
Here is the caller graph for this function:

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