00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_MCARLO_INTE_H 00024 #define O2SCL_MCARLO_INTE_H 00025 00026 #include <iostream> 00027 #include <o2scl/collection.h> 00028 #include <o2scl/multi_inte.h> 00029 #include <o2scl/rnga.h> 00030 #include <o2scl/gsl_rnga.h> 00031 00032 #ifndef DOXYGENP 00033 namespace o2scl { 00034 #endif 00035 00036 /** 00037 \brief Monte-Carlo integration base 00038 00039 There is no generic interface here since it would just be the 00040 same as that from multi_inte. This class just provides the 00041 generic Monte Carlo parameters and the random number 00042 generator. The default type for the random number generator 00043 is a \ref gsl_rnga object. 00044 */ 00045 template<class param_t, class func_t, class rng_t=gsl_rnga, 00046 class vec_t=ovector_view> class mcarlo_inte : 00047 public multi_inte<param_t,func_t,vec_t> { 00048 00049 public: 00050 00051 mcarlo_inte() { 00052 n_points=1000; 00053 } 00054 00055 virtual ~mcarlo_inte() {} 00056 00057 /// (default 1000) 00058 int n_points; 00059 00060 /// The random number generator 00061 rng_t def_rng; 00062 00063 /// Return string denoting type ("mcarlo_inte") 00064 virtual const char *type() { return "mcarlo_inte"; } 00065 00066 }; 00067 00068 #ifndef DOXYGENP 00069 } 00070 #endif 00071 00072 #endif 00073