MeanWalker
|
00001 /* 00002 00003 This file is a part of MeanWalker, a library which provides utilities to 00004 sample from probability distributions using methods like the 00005 Metropilis-Hastings algorithm and Goodman-Weare algorithm. 00006 00007 Copyright (C) 2012 Jori Liesenborgs 00008 00009 Contact: jori.liesenborgs@gmail.com 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with this program; if not, write to the Free Software 00023 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 */ 00026 00031 #ifndef MEANWALKER_METROPOLISHISTOGRAMBUILDER_H 00032 00033 #define MEANWALKER_METROPOLISHISTOGRAMBUILDER_H 00034 00035 #include "meanwalkerconfig.h" 00036 #include "histogrambuildertemplate.h" 00037 #include "metropoliswalker.h" 00038 #include "histogram.h" 00039 00040 namespace meanwalker 00041 { 00042 00051 class MEANWALKER_IMPORTEXPORT MetropolisHistogramBuilder : private HistogramBuilderTemplate<MetropolisWalker> 00052 { 00053 public: 00056 MetropolisHistogramBuilder(RandomNumberGenerator *pRndGen); 00057 ~MetropolisHistogramBuilder(); 00058 00075 bool init(Function *pProbFunction, const double *pMinCoords, const double *pMaxCoords, const double *pStartCoords, 00076 size_t numBins, bool keepInside = true, bool delayed = false); 00077 00078 using HistogramBuilderTemplate<MetropolisWalker>::run; 00079 using HistogramBuilderTemplate<MetropolisWalker>::clearHistograms; 00080 using HistogramBuilderTemplate<MetropolisWalker>::getHistogram; 00081 using HistogramBuilderTemplate<MetropolisWalker>::getHistograms; 00082 using HistogramBuilderTemplate<MetropolisWalker>::printHistograms; 00083 using MetropolisWalker::getDimension; 00084 using MetropolisWalker::getBestCoordinates; 00085 00086 using ErrorBase::getErrorString; 00087 protected: 00088 using HistogramBuilderTemplate<MetropolisWalker>::onNewSample; 00089 using HistogramBuilderTemplate<MetropolisWalker>::getHistogramMinMax; 00090 using HistogramBuilderTemplate<MetropolisWalker>::onRecordedValuesProcessed; 00091 using MetropolisWalker::stepToNewCoords; 00092 }; 00093 00094 } // end namespace 00095 00096 #endif // MEANWALKER_METROPOLISHISTOGRAMBUILDER_H 00097