00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
#ifndef _math_optimize_diis_h
00029
#define _math_optimize_diis_h
00030
00031
#ifdef __GNUC__
00032
#pragma interface
00033
#endif
00034
00035
#include <math/optimize/scextrap.h>
00036
00037
namespace sc {
00038
00040 class DIIS:
public SelfConsistentExtrapolation {
00041
protected:
00042
int start;
00043
int ndiis;
00044
int iter;
00045
int ngroup;
00046
int ngroupdiis;
00047
double damping_factor;
00048
00049
double * btemp;
00050
double ** bold;
00051
double ** bmat;
00052
00053
Ref<SCExtrapData> dtemp_data;
00054
Ref<SCExtrapError> dtemp_error;
00055
00056
Ref<SCExtrapData> Ldata;
00057
00058
Ref<SCExtrapData> *diism_data;
00059
Ref<SCExtrapError> *diism_error;
00060
00061
void init();
00062
public:
00063
DIIS(
int strt=1,
int ndi=5,
double dmp =0,
int ngr=1,
int ngrdiis=1);
00064
DIIS(
StateIn&);
00090
DIIS(
const Ref<KeyVal>&);
00091 ~
DIIS();
00092
00093
void save_data_state(
StateOut&);
00094
00095
int extrapolate(
const Ref<SCExtrapData>& data,
00096
const Ref<SCExtrapError>& error);
00097
00098
void start_extrapolation();
00099
00100
void reinitialize();
00101 };
00102
00103 }
00104
00105
#endif
00106
00107
00108
00109
00110