00001 // QMcBeaver 00002 // 00003 // Constructed by 00004 // 00005 // Michael Todd Feldmann 00006 // and 00007 // David Randall "Chip" Kent IV 00008 // 00009 // Copyright 2000. All rights reserved. 00010 // 00011 // drkent@users.sourceforge.net mtfeldmann@users.sourceforge.net 00012 00013 #ifndef QMCEigenSearch_H 00014 #define QMCEigenSearch_H 00015 00016 #include <math.h> 00017 00018 #include <vector> 00019 #include "QMCObjectiveFunction.h" 00020 #include "QMCOptimizationAlgorithm.h" 00021 #include "QMCLineSearchStepLengthSelectionAlgorithm.h" 00022 #include <sstream> 00023 00029 class QMCEigenSearch : public QMCOptimizationAlgorithm 00030 { 00031 public: 00042 QMCEigenSearch(QMCObjectiveFunction * function, 00043 QMCLineSearchStepLengthSelectionAlgorithm * stepAlg, 00044 int maxSteps, double tol); 00045 00049 virtual ~QMCEigenSearch(){}; 00050 00051 double get_a_diag(QMCDerivativeProperties & dp, double factor); 00052 00053 void setupHalfStep(); 00054 Array1D<double> getParameters(QMCDerivativeProperties & dp, double a_diag, bool verbose); 00055 00056 Array1D<double> optimize(Array1D<double> & initialGuess, 00057 QMCDerivativeProperties & dp, 00058 double a_diag_factor, 00059 int optStep); 00060 00061 protected: 00062 00063 static bool currentlyHalf; 00064 00068 QMCObjectiveFunction * getObjectiveFunction(); 00069 00070 int optStep; 00071 int dim; 00072 stringstream stepinfo; 00073 00074 static vector<double> f; 00075 static vector<double> variance; 00076 static vector< Array1D<double> > x; 00077 00078 private: 00079 static int orig_steps; 00080 static vector<double> adiag_tests; 00081 static Array1D<double> orig_params; 00082 static Array2D<double> hamiltonian; 00083 static Array2D<double> overlap; 00084 00088 QMCObjectiveFunction *OF; 00089 00093 QMCLineSearchStepLengthSelectionAlgorithm * stepLengthAlg; 00094 00098 double epsilon; 00099 00103 int maximumSteps; 00104 }; 00105 00106 #endif 00107 00108