00001 // @(#)root/mathmore:$Id: MCParameters.h 36806 2010-11-20 11:09:14Z moneta $ 00002 // Author: Magdalena Slawinska 08/2007 00003 00004 /********************************************************************** 00005 * * 00006 * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT * 00007 * * 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU General Public License * 00010 * as published by the Free Software Foundation; either version 2 * 00011 * of the License, or (at your option) any later version. * 00012 * * 00013 * This library 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 GNU * 00016 * General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this library (see file COPYING); if not, write * 00020 * to the Free Software Foundation, Inc., 59 Temple Place, Suite * 00021 * 330, Boston, MA 02111-1307 USA, or contact the author. * 00022 * * 00023 **********************************************************************/ 00024 00025 00026 #ifndef ROOT_Math_MCParameters 00027 #define ROOT_Math_MCParameters 00028 00029 #include <cstring> // for size_t 00030 00031 namespace ROOT { 00032 namespace Math { 00033 00034 00035 class IOptions; 00036 00037 /** 00038 structures collecting parameters 00039 for VEGAS multidimensional integration 00040 FOr implementation of default parameters see file 00041 mathmore/src/GSLMCIntegrationWorkspace.h 00042 00043 @ingroup MCIntegration 00044 */ 00045 struct VegasParameters{ 00046 double alpha; 00047 size_t iterations; 00048 int stage; 00049 int mode; 00050 int verbose; 00051 00052 // constructor of default parameters 00053 VegasParameters() { SetDefaultValues(); } 00054 00055 // construct from GenAlgoOptions 00056 // parameter not specified are ignored 00057 VegasParameters(const ROOT::Math::IOptions & opt); 00058 00059 void SetDefaultValues(); 00060 00061 VegasParameters & operator=(const ROOT::Math::IOptions & opt); 00062 00063 /// convert to options (return object is managed by the user) 00064 ROOT::Math::IOptions * operator() () const; 00065 }; 00066 00067 00068 00069 00070 /** 00071 structures collecting parameters 00072 for MISER multidimensional integration 00073 00074 @ingroup MCIntegration 00075 */ 00076 struct MiserParameters{ 00077 double estimate_frac; 00078 size_t min_calls; 00079 size_t min_calls_per_bisection; 00080 double alpha; 00081 double dither; 00082 00083 // constructor of default parameters 00084 // needs dimension since min_calls = 16 * dim 00085 MiserParameters(size_t dim=10) { SetDefaultValues(dim); } 00086 00087 void SetDefaultValues(size_t dim=10); 00088 00089 // construct from GenAlgoOptions 00090 // parameter not specified are ignored 00091 MiserParameters(const ROOT::Math::IOptions & opt, size_t dim = 10); 00092 00093 MiserParameters & operator=(const ROOT::Math::IOptions & opt); 00094 00095 /// convert to options (return object is managed by the user) 00096 ROOT::Math::IOptions * operator() () const; 00097 00098 }; 00099 00100 struct PlainParameters{ 00101 }; 00102 00103 } // namespace Math 00104 } // namespace ROOT 00105 00106 #endif