A interface to line search.
More...
#include <opt_DCsrch.h>
|
| Opt_DCsrch () |
|
| ~Opt_DCsrch () |
|
void | set_paras (double ftol=1e-4, double gtol=2e-1, double xtol=1e-12, double stpmin=0., double stpmax=ModuleBase::PI) |
| Reset following parameters. The default setting in PROFESS is TN ftol = 1e-4 gtol = 2e-1 CG ftol = 1e-4 gtol = 1e-2 BFGS ftol = 1e-4 gtol = 2e-1.
|
|
void | dcSrch (double &f, double &g, double &rstp, char *rtask) |
| Interface to dcsrch, finding the optimal step length with line search.
|
|
A interface to line search.
◆ Opt_DCsrch()
ModuleBase::Opt_DCsrch::Opt_DCsrch |
( |
| ) |
|
|
inline |
◆ ~Opt_DCsrch()
ModuleBase::Opt_DCsrch::~Opt_DCsrch |
( |
| ) |
|
|
inline |
◆ dcSrch()
void ModuleBase::Opt_DCsrch::dcSrch |
( |
double & |
f, |
|
|
double & |
g, |
|
|
double & |
rstp, |
|
|
char * |
rtask |
|
) |
| |
Interface to dcsrch, finding the optimal step length with line search.
- Parameters
-
f | the value of the function at x on initial entry. On subsequent entries f is the value of the function at x + stp * d. |
g | the derivative of the function at 0 on initial entry. On subsequent entries g is the derivative of the function at x + stp * d. |
rstp | the optimized step length, assert the initial value is larger than zero. |
rtask | a character variable of length at least 60. On initial entry task must be set to 'START'. On exit task indicates the required action: If task(1:2) = 'FG' then evaluate the function and derivative at stp and call dcsrch again. If task(1:4) = 'CONV' then the search is successful. If task(1:4) = 'WARN' then the subroutine is not able to satisfy the convergence conditions. The exit value of stp contains the best point found during the search. If task(1:5) = 'ERROR' then there is an error in the input arguments. |
◆ set_paras()
void ModuleBase::Opt_DCsrch::set_paras |
( |
double |
ftol = 1e-4 , |
|
|
double |
gtol = 2e-1 , |
|
|
double |
xtol = 1e-12 , |
|
|
double |
stpmin = 0. , |
|
|
double |
stpmax = ModuleBase::PI |
|
) |
| |
|
inline |
Reset following parameters. The default setting in PROFESS is TN ftol = 1e-4 gtol = 2e-1 CG ftol = 1e-4 gtol = 1e-2 BFGS ftol = 1e-4 gtol = 2e-1.
- Parameters
-
ftol | nonnegative tolerance for the sufficient decrease condition. |
gtol | nonnegative tolerance for the curvature condition. |
xtol | nonnegative relative tolerance for an acceptable step. The subroutine exits with a warning if the relative difference between sty and stx is less than xtol. |
stpmin | nonnegative lower bound for the step. |
stpmax | nonnegative upper bound for the step. |
◆ dsave_
double* ModuleBase::Opt_DCsrch::dsave_ = nullptr |
|
private |
◆ ftol_
double ModuleBase::Opt_DCsrch::ftol_ = 1e-4 |
|
private |
◆ gtol_
double ModuleBase::Opt_DCsrch::gtol_ = 2e-1 |
|
private |
◆ isave_
int* ModuleBase::Opt_DCsrch::isave_ = nullptr |
|
private |
◆ stpmax_
◆ stpmin_
double ModuleBase::Opt_DCsrch::stpmin_ = 0. |
|
private |
◆ xtol_
double ModuleBase::Opt_DCsrch::xtol_ = 1e-12 |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/opt_DCsrch.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/opt_DCsrch.cpp