Preconditioner.h 1.28 KB
Newer Older
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3 4 5 6
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
15 16 17 18 19 20 21
// Preconditioner.h
//
////////////////////////////////////////////////////////////////////////////////

#ifndef PRECONDITIONER_H
#define PRECONDITIONER_H

Francois Gygi committed
22
class Wavefunction;
23
class EnergyFunctional;
24 25 26 27 28 29 30

#include <vector>
#include <valarray>

class Preconditioner
{
  private:
31

32 33
  EnergyFunctional& ef_;

Francois Gygi committed
34 35 36 37 38 39
  // kpg2_[ispin][ikp][ig]
  std::vector<std::vector<const double *> > kpg2_;
  // ekin_[ispin][ikp][n]
  std::vector<std::vector<std::valarray<double> > > ekin_;

  double ecutprec_;
40 41 42

  public:

Francois Gygi committed
43 44
  // update values of ekin_
  void update(const Wavefunction& wf);
45

Francois Gygi committed
46
  double diag(int ispin, int ikp, int n, int ig) const;
47

48
  Preconditioner(const Wavefunction& wf, EnergyFunctional& ef, double ecutprec);
49 50 51
  //~Preconditioner();
};
#endif