00001
00002
00003
00004 #ifndef Converge_h
00005 #define Converge_h
00006
00007 #include "Distribution.h"
00008 #include "Ensemble.h"
00009
00010 #include "Serializable.h"
00011
00012
00013 namespace BIE {
00014
00015
00020 class Converge : public SampleDistribution
00021 {
00022 public:
00024 Converge() {}
00025
00026
00027
00028
00029
00030
00032 virtual bool Converged() { return false;}
00033
00035 virtual Converge* New(int m, Ensemble* d, string id) {
00036 return new Converge();
00037 }
00038
00040 virtual bool AccumData(double value, State& state) {
00041 return true;
00042 };
00043
00045 virtual bool AccumData(vector<double>& values, vector<State>& states) {
00046 return true;
00047 };
00048
00050 virtual bool GetLast(double& value, State& state) {
00051 return false;
00052 }
00053
00055 virtual bool GetLast(vector<double>& value, vector<State>& state) {
00056 return false;
00057 }
00058
00059
00061 virtual bool IsParallel() {
00062 return false;
00063 }
00064
00066 virtual int ConvergedIndex() { return 0; }
00067
00069 bool AccumulateData(double v, RecordBuffer* datapoint) {
00070 cerr << "Not implemented for a Convergence statististic . . . \n";
00071 return false;
00072 }
00073
00074
00075 private:
00076 friend class boost::serialization::access;
00077 template<class Archive>
00078 void serialize(Archive & ar, const unsigned int version) {
00079 this->pre_serialize(ar, version);
00080 try {
00081 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SampleDistribution);
00082 BIE_CATCH_BOOST_SERIALIZATION_EXCEPTION;
00083 }
00084 this->post_serialize(ar, version);
00085 }
00086
00087 };
00088 }
00089
00090 BIE_CLASS_TYPE_INFO(BIE::Converge)
00091 BIE_CLASS_EXPORT_KEY(BIE::Converge)
00092 #endif