ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
BFGS_Basic Class Reference

#include <bfgs_basic.h>

Inheritance diagram for BFGS_Basic:
Collaboration diagram for BFGS_Basic:

Public Member Functions

 BFGS_Basic ()
 ~BFGS_Basic ()=default
std::vector< double > & get_pos ()
 3N coordinates of the system ( x )
std::vector< double > & get_grad ()
 3N components of ( grad( V(x) ) )
std::vector< double > & get_move ()
 the step taken, pos = pos_p + move
std::vector< double > & get_pos_p ()
 coordinates of the previous step
std::vector< double > & get_grad_p ()
 gradient of the previous step
std::vector< double > & get_move_p ()
 step taken at the previous step
bool & get_save_flag ()
 whether a bfgs state has been saved
bool & get_tr_min_hit ()
 whether the trust radius already hit its minimum last step
bool & get_wolfe_flag ()
 whether the Wolfe conditions were satisfied
ModuleBase::matrix & get_inv_hess ()
 the inverse Hessian of the BFGS update
int & get_bfgs_ndim ()
 number of previous steps kept by the BFGS update
void allocate_basic_for_testing ()
void new_step_for_testing (const double &lat0, int &update_iter, std::ofstream &ofs, std::vector< double > &etot_info, const int test_relax_method)
void reset_hessian_for_testing ()
void save_bfgs_for_testing ()
void update_inverse_hessian_for_testing (const double &lat0, std::ofstream &ofs)
void check_wolfe_conditions_for_testing (std::ofstream &ofs, std::vector< double > &etot_info)
void compute_trust_radius_for_testing (std::ofstream &ofs, std::vector< double > &etot_info, const int test_relax_method)

Static Public Attributes

static double relax_bfgs_w1 = -1.0
static double relax_bfgs_w2 = -1.0

Protected Member Functions

void allocate_basic (void)
void new_step (const double &lat0, int &update_iter, std::ofstream &ofs, std::vector< double > &etot_info, const int test_relax_method)
void reset_hessian (void)
void save_bfgs (void)
double check_move (const double &lat0, const double &pos, const double &pos_p)

Protected Attributes

std::vector< double > pos
std::vector< double > grad
std::vector< double > move
std::vector< double > pos_p
std::vector< double > grad_p
std::vector< double > move_p
bool save_flag = false
bool tr_min_hit = false

Private Member Functions

void update_inverse_hessian (const double &lat0, std::ofstream &ofs)
void check_wolfe_conditions (std::ofstream &ofs, std::vector< double > &etot_info)
void compute_trust_radius (std::ofstream &ofs, std::vector< double > &etot_info, const int test_relax_method)

Private Attributes

bool wolfe_flag = false
ModuleBase::matrix inv_hess
int bfgs_ndim

Constructor & Destructor Documentation

◆ BFGS_Basic()

BFGS_Basic::BFGS_Basic ( )

◆ ~BFGS_Basic()

BFGS_Basic::~BFGS_Basic ( )
default

Member Function Documentation

◆ allocate_basic()

void BFGS_Basic::allocate_basic ( void )
protected
Here is the caller graph for this function:

◆ allocate_basic_for_testing()

void BFGS_Basic::allocate_basic_for_testing ( )
inline
Here is the call graph for this function:

◆ check_move()

double BFGS_Basic::check_move ( const double & lat0,
const double & pos,
const double & pos_p )
protected
Here is the caller graph for this function:

◆ check_wolfe_conditions()

void BFGS_Basic::check_wolfe_conditions ( std::ofstream & ofs,
std::vector< double > & etot_info )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_wolfe_conditions_for_testing()

void BFGS_Basic::check_wolfe_conditions_for_testing ( std::ofstream & ofs,
std::vector< double > & etot_info )
inline
Here is the call graph for this function:

◆ compute_trust_radius()

void BFGS_Basic::compute_trust_radius ( std::ofstream & ofs,
std::vector< double > & etot_info,
const int test_relax_method )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_trust_radius_for_testing()

void BFGS_Basic::compute_trust_radius_for_testing ( std::ofstream & ofs,
std::vector< double > & etot_info,
const int test_relax_method )
inline
Here is the call graph for this function:

◆ get_bfgs_ndim()

int & BFGS_Basic::get_bfgs_ndim ( )
inline

number of previous steps kept by the BFGS update

◆ get_grad()

std::vector< double > & BFGS_Basic::get_grad ( )
inline

3N components of ( grad( V(x) ) )

Here is the caller graph for this function:

◆ get_grad_p()

std::vector< double > & BFGS_Basic::get_grad_p ( )
inline

gradient of the previous step

Here is the caller graph for this function:

◆ get_inv_hess()

ModuleBase::matrix & BFGS_Basic::get_inv_hess ( )
inline

the inverse Hessian of the BFGS update

Here is the caller graph for this function:

◆ get_move()

std::vector< double > & BFGS_Basic::get_move ( )
inline

the step taken, pos = pos_p + move

Here is the caller graph for this function:

◆ get_move_p()

std::vector< double > & BFGS_Basic::get_move_p ( )
inline

step taken at the previous step

Here is the caller graph for this function:

◆ get_pos()

std::vector< double > & BFGS_Basic::get_pos ( )
inline

3N coordinates of the system ( x )

Here is the caller graph for this function:

◆ get_pos_p()

std::vector< double > & BFGS_Basic::get_pos_p ( )
inline

coordinates of the previous step

Here is the caller graph for this function:

◆ get_save_flag()

bool & BFGS_Basic::get_save_flag ( )
inline

whether a bfgs state has been saved

Here is the caller graph for this function:

◆ get_tr_min_hit()

bool & BFGS_Basic::get_tr_min_hit ( )
inline

whether the trust radius already hit its minimum last step

Here is the caller graph for this function:

◆ get_wolfe_flag()

bool & BFGS_Basic::get_wolfe_flag ( )
inline

whether the Wolfe conditions were satisfied

◆ new_step()

void BFGS_Basic::new_step ( const double & lat0,
int & update_iter,
std::ofstream & ofs,
std::vector< double > & etot_info,
const int test_relax_method )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ new_step_for_testing()

void BFGS_Basic::new_step_for_testing ( const double & lat0,
int & update_iter,
std::ofstream & ofs,
std::vector< double > & etot_info,
const int test_relax_method )
inline
Here is the call graph for this function:

◆ reset_hessian()

void BFGS_Basic::reset_hessian ( void )
protected
Here is the caller graph for this function:

◆ reset_hessian_for_testing()

void BFGS_Basic::reset_hessian_for_testing ( )
inline
Here is the call graph for this function:

◆ save_bfgs()

void BFGS_Basic::save_bfgs ( void )
protected
Here is the caller graph for this function:

◆ save_bfgs_for_testing()

void BFGS_Basic::save_bfgs_for_testing ( )
inline
Here is the call graph for this function:

◆ update_inverse_hessian()

void BFGS_Basic::update_inverse_hessian ( const double & lat0,
std::ofstream & ofs )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_inverse_hessian_for_testing()

void BFGS_Basic::update_inverse_hessian_for_testing ( const double & lat0,
std::ofstream & ofs )
inline
Here is the call graph for this function:

Member Data Documentation

◆ bfgs_ndim

int BFGS_Basic::bfgs_ndim
private

◆ grad

std::vector<double> BFGS_Basic::grad
protected

◆ grad_p

std::vector<double> BFGS_Basic::grad_p
protected

◆ inv_hess

ModuleBase::matrix BFGS_Basic::inv_hess
private

◆ move

std::vector<double> BFGS_Basic::move
protected

◆ move_p

std::vector<double> BFGS_Basic::move_p
protected

◆ pos

std::vector<double> BFGS_Basic::pos
protected

◆ pos_p

std::vector<double> BFGS_Basic::pos_p
protected

◆ relax_bfgs_w1

double BFGS_Basic::relax_bfgs_w1 = -1.0
static

◆ relax_bfgs_w2

double BFGS_Basic::relax_bfgs_w2 = -1.0
static

◆ save_flag

bool BFGS_Basic::save_flag = false
protected

◆ tr_min_hit

bool BFGS_Basic::tr_min_hit = false
protected

◆ wolfe_flag

bool BFGS_Basic::wolfe_flag = false
private

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