ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
opt_dcsrch.h
Go to the documentation of this file.
1#ifndef OPT_DCSRCH_H
2#define OPT_DCSRCH_H
3
4#include <iostream>
5#include <string>
6
7#include "constants.h"
8
9namespace ModuleBase
10{
11
17{
18 public:
20 {
21 this->isave_ = new int[3];
22 this->dsave_ = new double[14];
23 }
25 {
26 delete[] this->isave_;
27 delete[] this->dsave_;
28 }
29
30 //
31 //
32 //
47 void set_paras(double ftol = 1e-4,
48 double gtol = 2e-1,
49 double xtol = 1e-12,
50 double stpmin = 0.,
51 double stpmax = ModuleBase::PI)
52 {
53 this->ftol_ = ftol;
54 this->gtol_ = gtol;
55 this->xtol_ = xtol;
56 this->stpmin_ = stpmin;
57 this->stpmax_ = stpmax;
58 }
59
77 void dcSrch(double& f, double& g, double& rstp, std::string& rtask);
78
79 private:
80 double ftol_ = 1e-4; // nonnegative tolerance for the sufficient decrease condition.
81 double gtol_ = 2e-1; // nonnegative tolerance for the curvature condition.
82 double xtol_ = 1e-12; // nonnegative relative tolerance for an acceptable step. The subroutine exits with a warning
83 // if the relative difference between sty and stx is less than xtol.
84 double stpmin_ = 0.; // nonnegative lower bound for the step.
85 double stpmax_ = ModuleBase::PI; // nonnegative upper bound for the step.
86 int* isave_ = nullptr; // an integer work array of dimension 2.
87 double* dsave_ = nullptr; // a double precision work array of dimension 13.
88};
89} // namespace ModuleBase
90
91#endif
double stpmax_
Definition opt_dcsrch.h:85
void dcSrch(double &f, double &g, double &rstp, std::string &rtask)
Interface to dcsrch, finding the optimal step length with line search.
Definition opt_dcsrch.cpp:717
double xtol_
Definition opt_dcsrch.h:82
double gtol_
Definition opt_dcsrch.h:81
double * dsave_
Definition opt_dcsrch.h:87
double ftol_
Definition opt_dcsrch.h:80
~Opt_DCsrch()
Definition opt_dcsrch.h:24
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...
Definition opt_dcsrch.h:47
Opt_DCsrch()
Definition opt_dcsrch.h:19
int * isave_
Definition opt_dcsrch.h:86
double stpmin_
Definition opt_dcsrch.h:84
Definition clebsch_gordan_coeff.cpp:8
const double PI
Definition constants.h:19