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 QMCOBJECTIVEFUNCTIONRESULTS_H 00014 #define QMCOBJECTIVEFUNCTIONRESULTS_H 00015 00016 #include "IeeeMath.h" 00017 #include "QMCInput.h" 00018 00019 //This number will be returned as a result if any number gets 00020 //too big or small or nan. 00021 #define MAX_RESULT_VALUE 1e8 00022 00029 class QMCObjectiveFunctionResult 00030 { 00031 public: 00035 QMCObjectiveFunctionResult(); 00036 ~QMCObjectiveFunctionResult(); 00037 00049 QMCObjectiveFunctionResult(QMCInput *input, 00050 double energyAve, double energyVar, 00051 double logWeightAve, double logWeightVar, 00052 int numSamples, 00053 Array1D<Complex> & poles); 00054 00061 QMCObjectiveFunctionResult(QMCObjectiveFunctionResult & rhs); 00062 00069 double getLogWeightsAve(); 00070 00077 double getLogWeightsVar(); 00078 00084 double getEnergyAve() const; 00085 00091 double getEnergyVar() const; 00092 00093 int getNumberSamples() const; 00094 00103 double getScore() const; 00104 00114 double getDerivativeScore(); 00115 00121 void operator=(const QMCObjectiveFunctionResult &rhs); 00122 00126 friend ostream& operator<<(ostream & strm, 00127 const QMCObjectiveFunctionResult & rhs); 00128 00129 private: 00130 int numSamples; 00131 double log_weights_ave; 00132 double log_weights_var; 00133 double energy_ave; 00134 double energy_var; 00135 00136 double score; 00137 double score_for_derivative; 00138 00139 QMCInput *Input; 00140 00141 void set_log_weights_ave(double wa); 00142 void set_log_weights_var(double wv); 00143 void set_energy_ave(double ea); 00144 void set_energy_var(double ev); 00145 00146 void set_score(Array1D<Complex> & poles); 00147 void set_score_for_derivative(Array1D<Complex> & poles); 00148 00149 //This will calculate the penalty function and return a score for a 00150 //parameter set 00151 double mikes_score_function(); 00152 double mikes_penalty(double x); 00153 double mikes_penalty_scaler(double x); 00154 00155 double calculate_monkey_spank(); 00156 double calculate_umrigar88(); 00157 }; 00158 00159 #endif