Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:19

0001 // @(#)root/mathmore:$Id$
0002 // Author: Magdalena Slawinska 08/2007
0003 
0004  /**********************************************************************
0005   *                                                                    *
0006   * Copyright (c) 2004 ROOT Foundation,  CERN/PH-SFT                   *
0007   *                                                                    *
0008   * This library is free software; you can redistribute it and/or      *
0009   * modify it under the terms of the GNU General Public License        *
0010   * as published by the Free Software Foundation; either version 2     *
0011   * of the License, or (at your option) any later version.             *
0012   *                                                                    *
0013   * This library is distributed in the hope that it will be useful,    *
0014   * but WITHOUT ANY WARRANTY; without even the implied warranty of     *
0015   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
0016   * General Public License for more details.                           *
0017   *                                                                    *
0018   * You should have received a copy of the GNU General Public License  *
0019   * along with this library (see file COPYING); if not, write          *
0020   * to the Free Software Foundation, Inc., 59 Temple Place, Suite      *
0021   * 330, Boston, MA 02111-1307 USA, or contact the author.             *
0022   *                                                                    *
0023   **********************************************************************/
0024 
0025 
0026 #ifndef ROOT_Math_MCParameters
0027 #define ROOT_Math_MCParameters
0028 
0029 #include <cstddef>   // for size_t
0030 #include <memory>  // for unique_ptr
0031 
0032 #include "Math/IOptions.h"
0033 
0034 namespace ROOT {
0035 namespace Math {
0036 
0037 
0038 /**
0039    Structures collecting parameters
0040    for VEGAS multidimensional integration
0041    For implementation of default parameters see file
0042    mathmore/src/GSLMCIntegrationWorkspace.h
0043 
0044    @ingroup MCIntegration
0045 */
0046 struct VegasParameters{
0047    double alpha;
0048    size_t iterations;
0049    int stage;
0050    int mode;
0051    int verbose;
0052 
0053    // constructor of default parameters
0054    VegasParameters() { SetDefaultValues(); }
0055 
0056    // construct from GenAlgoOptions
0057    // parameter not specified are ignored
0058    VegasParameters(const ROOT::Math::IOptions & opt);
0059 
0060    void SetDefaultValues();
0061 
0062    VegasParameters & operator=(const ROOT::Math::IOptions & opt);
0063 
0064    /// Convert to options
0065    std::unique_ptr<ROOT::Math::IOptions>  MakeIOptions() const;
0066 };
0067 
0068 
0069 
0070 
0071 /**
0072    Structure collecting parameters
0073    for MISER multidimensional integration
0074 
0075    @ingroup MCIntegration
0076 */
0077 struct MiserParameters{
0078    double estimate_frac;
0079    size_t min_calls;
0080    size_t min_calls_per_bisection;
0081    double alpha;
0082    double dither;
0083 
0084    // constructor of default parameters
0085    // needs dimension since min_calls = 16 * dim
0086    MiserParameters(size_t dim=10) { SetDefaultValues(dim); }
0087 
0088    void SetDefaultValues(size_t dim=10);
0089 
0090    // construct from GenAlgoOptions
0091    // parameter not specified are ignored
0092    MiserParameters(const ROOT::Math::IOptions & opt, size_t dim = 10);
0093 
0094    MiserParameters & operator=(const ROOT::Math::IOptions & opt);
0095 
0096    /// convert to options (return object is managed by the user)
0097    std::unique_ptr<ROOT::Math::IOptions> MakeIOptions() const;
0098 
0099 };
0100 
0101 struct PlainParameters{
0102 };
0103 
0104 } // namespace Math
0105 } // namespace ROOT
0106 
0107 #endif