Object-oriented Scientific Computing Library: Version 0.910
mcarlo_inte.h
00001 /*
00002   -------------------------------------------------------------------
00003   
00004   Copyright (C) 2006-2012, 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/multi_inte.h>
00028 #include <o2scl/rnga.h>
00029 #include <o2scl/gsl_rnga.h>
00030 
00031 #ifndef DOXYGENP
00032 namespace o2scl {
00033 #endif
00034 
00035   /** \brief Monte-Carlo integration [abstract base]
00036       
00037       This class provides the generic Monte Carlo parameters and the
00038       random number generator. The default type for the random number
00039       generator is a \ref gsl_rnga object. 
00040   */
00041   template<class func_t, class rng_t=gsl_rnga, 
00042     class vec_t=ovector_base> class mcarlo_inte : 
00043     public multi_inte<func_t,vec_t> {
00044 
00045       public:
00046       
00047       mcarlo_inte() {
00048         n_points=1000;
00049       }
00050 
00051       virtual ~mcarlo_inte() {}
00052   
00053       /** \brief Number of integration points (default 1000)
00054       */
00055       unsigned long n_points;
00056     
00057       /// The random number generator
00058       rng_t def_rng;
00059   
00060       /// Return string denoting type ("mcarlo_inte")
00061       virtual const char *type() { return "mcarlo_inte"; }
00062   
00063     };
00064 
00065 #ifndef DOXYGENP
00066 }
00067 #endif
00068 
00069 #endif
00070 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.