JDFTx  1.1.0
BandMinimizer.h
1 /*-------------------------------------------------------------------
2 Copyright 2013 Deniz Gunceler
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_ELECTRONIC_BANDMINIMIZER_H
21 #define JDFTX_ELECTRONIC_BANDMINIMIZER_H
22 
23 #include <electronic/common.h>
24 #include <core/Minimize.h>
25 #include <electronic/ColumnBundle.h>
26 
27 class BandMinimizer : public Minimizable<ColumnBundle>
28 {
29  public:
30  BandMinimizer(Everything& e, int qActive, bool precond=true);
31 
32  double compute(ColumnBundle* grad);
33  void step(const ColumnBundle& dir, double alpha);
35  bool report(int iter);
36  void constrain(ColumnBundle&);
37 
38  int qActive;
39 
41  private:
42  Everything& e;
43  ElecVars& eVars;
44  bool precond;
45 };
46 
47 #endif
bool report(int iter)
double compute(ColumnBundle *grad)
Returns the objective function at the current state and store the gradient in grad, if non-null.
ColumnBundle precondition(const ColumnBundle &grad)
Definition: BandMinimizer.h:27
ColumnBundle Kgrad
Quantum number of the subspace that is being minimized.
Definition: BandMinimizer.h:40
void constrain(ColumnBundle &)
Definition: Everything.h:41
Definition: ElecVars.h:30
Nonlinear minimization templates.
Definition: Minimize.h:45
void step(const ColumnBundle &dir, double alpha)
Move the state in parameter space along direction dir with scale alpha.
Definition: ColumnBundle.h:30