MeanWalker

goodmanwearehistogrambuilder.h

Go to the documentation of this file.
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_GOODMANWEAREHISTOGRAMBUILDER_H
00032 
00033 #define MEANWALKER_GOODMANWEAREHISTOGRAMBUILDER_H
00034 
00035 #include "meanwalkerconfig.h"
00036 #include "histogrambuildertemplate.h"
00037 #include "goodmanwearewalkers.h"
00038 #include "histogram.h"
00039 
00040 namespace meanwalker
00041 {
00042 
00051 class MEANWALKER_IMPORTEXPORT GoodmanWeareHistogramBuilder : private HistogramBuilderTemplate<GoodmanWeareWalkers>
00052 {
00053 public:
00056         GoodmanWeareHistogramBuilder(RandomNumberGenerator *pRng);
00057         ~GoodmanWeareHistogramBuilder();
00058 
00079         bool init(Function *pProbFunction, const double *pStartCoordCenter, double startCoordRadius,
00080                   size_t numBins, const double *pHistMinCoords = 0, const double *pHistMaxCoords = 0, 
00081                   double a = 2.0, int Nwalkers = 0);
00082         
00105         bool init(Function *pProbFunction, const double *pStartCoordCenter, const double *pStartCoordRadii,
00106                   size_t numBins, const double *pHistMinCoords = 0, const double *pHistMaxCoords = 0, 
00107                   double a = 2.0, int Nwalkers = 0);
00108         
00109         using HistogramBuilderTemplate<GoodmanWeareWalkers>::run;
00110         using HistogramBuilderTemplate<GoodmanWeareWalkers>::clearHistograms;
00111         using HistogramBuilderTemplate<GoodmanWeareWalkers>::getHistogram;
00112         using HistogramBuilderTemplate<GoodmanWeareWalkers>::getHistograms;
00113         using HistogramBuilderTemplate<GoodmanWeareWalkers>::printHistograms;
00114         using GoodmanWeareWalkers::getDimension;
00115         using GoodmanWeareWalkers::getBestCoordinates;
00116         using GoodmanWeareWalkers::getNumberOfWalkers;
00117 
00118         using errut::ErrorBase::getErrorString;
00119 protected:
00120         using HistogramBuilderTemplate<GoodmanWeareWalkers>::onNewSample;
00121         using HistogramBuilderTemplate<GoodmanWeareWalkers>::getHistogramMinMax;
00122         using HistogramBuilderTemplate<GoodmanWeareWalkers>::onRecordedValuesProcessed;
00123 };
00124 
00125 #endif // MEANWALKER_GOODMANWEAREHISTOGRAMBUILDER_H
00126 
00127 } // end namespace   
00128