JDFTx  1.2.0
MinimizeParams.h
1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman, Kendra Letchworth Weaver
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx. If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_CORE_MINIMIZEPARAMS_H
21 #define JDFTX_CORE_MINIMIZEPARAMS_H
22 
23 #include <cstdio>
24 
27 
30 {
38  } dirUpdateScheme;
39 
44  Quad,
46  } linminMethod;
47 
49  int nDim;
50  int history;
51  FILE* fpLog;
52  const char* linePrefix;
53  const char* energyLabel;
54  const char* energyFormat;
55  double knormThreshold;
58 
59  double alphaTstart;
60  double alphaTmin;
62 
66 
67  double wolfeEnergy;
68  double wolfeGradient;
69 
70  bool fdTest;
71 
74  : dirUpdateScheme(PolakRibiere), linminMethod(DirUpdateRecommended),
75  nIterations(100), nDim(1), history(15), fpLog(stdout),
76  linePrefix("CG\t"), energyLabel("E"), energyFormat("%22.15le"),
77  knormThreshold(0), energyDiffThreshold(0), nEnergyDiff(2),
78  alphaTstart(1.0), alphaTmin(1e-10), updateTestStepSize(true),
79  alphaTreduceFactor(0.1), alphaTincreaseFactor(3.0), nAlphaAdjustMax(3),
80  wolfeEnergy(1e-4), wolfeGradient(0.9),
81  fdTest(false) {}
82 };
83 
85 
86 #endif // JDFTX_CORE_MINIMIZEPARAMS_H
double alphaTmin
minimum value of the test-step size (algorithm gives up when difficulties cause alphaT to fall below ...
Definition: MinimizeParams.h:60
Limited memory version of the BFGS algorithm.
Definition: MinimizeParams.h:36
LinminMethod
Line minimization method.
Definition: MinimizeParams.h:41
int nIterations
Maximum number of iterations (default 100)
Definition: MinimizeParams.h:48
Hestenes-Stiefel (preconditioned) conjugate gradients.
Definition: MinimizeParams.h:35
int history
Number of past variables and residuals to store (BFGS only)
Definition: MinimizeParams.h:50
Parameters to control the minimization algorithm.
Definition: MinimizeParams.h:29
double energyDiffThreshold
stop when energy change is below this for nEnergyDiff successive iterations (default: 0) ...
Definition: MinimizeParams.h:56
Cubic line search terminated by Wolfe conditions, possibly without a test step.
Definition: MinimizeParams.h:45
double alphaTreduceFactor
Factor to reduce alphaT on difficulties (default 0.1)
Definition: MinimizeParams.h:63
move by a constant multiple (=alphaTstart) of the search direction (not recommended for CG) ...
Definition: MinimizeParams.h:43
double alphaTstart
initial value for the test-step size (default: 1.0)
Definition: MinimizeParams.h:59
int nEnergyDiff
number of successive iterations for energyDiffThreshold check (default: 2)
Definition: MinimizeParams.h:57
Steepest Descent (always along negative (preconditioned) gradient)
Definition: MinimizeParams.h:37
double knormThreshold
stop when norm of residual against preconditioner falls below this (default: 0)
Definition: MinimizeParams.h:55
default method recommended by the direction update scheme
Definition: MinimizeParams.h:42
MinimizeParams()
Set the default values.
Definition: MinimizeParams.h:73
double wolfeGradient
Wolfe criterion dimensionless threshold for gradient.
Definition: MinimizeParams.h:68
bool updateTestStepSize
set alphaT=alpha after every iteration if true (default: true)
Definition: MinimizeParams.h:61
double wolfeEnergy
Wolfe criterion dimensionless threshold for energy.
Definition: MinimizeParams.h:67
double alphaTincreaseFactor
Max ratio of alpha to alphaT, increase alphaT by this factor otherwise (default 3.0)
Definition: MinimizeParams.h:64
Polak-Ribiere (preconditioned) conjugate gradients (default)
Definition: MinimizeParams.h:33
const char * linePrefix
prefix for each output line of minimizer, useful for nested minimizations (default "CG\t") ...
Definition: MinimizeParams.h:52
const char * energyLabel
Label for the minimized quantity (default "E")
Definition: MinimizeParams.h:53
Fletcher-Reeves (preconditioned) conjugate gradients.
Definition: MinimizeParams.h:34
int nDim
Dimension of optimization space; used only for knormThreshold (default 1)
Definition: MinimizeParams.h:49
int nAlphaAdjustMax
maximum number of times to alpha adjust attempts (default 3)
Definition: MinimizeParams.h:65
const char * energyFormat
printf format for the minimized quantity (default "%22.15le")
Definition: MinimizeParams.h:54
FILE * fpLog
Stream to log iterations to.
Definition: MinimizeParams.h:51
DirectionUpdateScheme
Search direction update scheme.
Definition: MinimizeParams.h:32
bool fdTest
whether to perform a finite difference test before each minimization (default false) ...
Definition: MinimizeParams.h:70
use the energy at a test step location to find the minimum along the line (default) ...
Definition: MinimizeParams.h:44