Logo ROOT  
Reference Guide
DistSamplerOptions.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Author: L. Moneta Fri Aug 15 2008
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2008 LCG ROOT Math Team, CERN/PH-SFT *
7 * *
8 * *
9 **********************************************************************/
10
11#ifndef ROOT_Math_DistSamplerOptions
12#define ROOT_Math_DistSamplerOptions
13
14#include <string>
15
16#include <iostream>
17
18namespace ROOT {
19
20
21namespace Math {
22
23
24class IOptions;
25
26//_______________________________________________________________________________
27/**
28 DistSampler options class
29
30 @ingroup NumAlgo
31*/
33
34public:
35
36 // static methods for setting and retrieving the default options
37
38 static void SetDefaultSampler(const char * type);
39 static void SetDefaultAlgorithm1D(const char * algo );
40 static void SetDefaultAlgorithmND(const char * algo );
41 static void SetDefaultPrintLevel(int level);
42
43 static const std::string & DefaultSampler();
44 static const std::string & DefaultAlgorithm1D();
45 static const std::string & DefaultAlgorithmND();
46 static int DefaultPrintLevel();
47
48 /// retrieve extra options - if not existing create a IOptions
49 static ROOT::Math::IOptions & Default(const char * name);
50
51 // find extra options - return 0 if not existing
52 static ROOT::Math::IOptions * FindDefault(const char * name);
53
54 /// print all the default options for the name given
55 static void PrintDefault(const char * name, std::ostream & os = std::cout);
56
57public:
58
59 // constructor using the default options
60 // pass optionally a pointer to the additional options
61 // otherwise look if they exist for this default minimizer
62 // and in that case they are copied in the constructed instance
63 // constructor takes dimension since a different default algorithm
64 // is used if the dimension is 1 or greater than 1
65 DistSamplerOptions(int dim = 0);
66
67 // destructor
69
70 // copy constructor
72
73 /// assignment operators
75
76 /** non-static methods for retrivieng options */
77
78 /// set print level
79 int PrintLevel() const { return fLevel; }
80
81 /// return extra options (NULL pointer if they are not present)
82 IOptions * ExtraOptions() const { return fExtraOptions; }
83
84 /// type of minimizer
85 const std::string & Sampler() const { return fSamplerType; }
86
87 /// type of algorithm
88 const std::string & Algorithm() const { return fAlgoType; }
89
90 /// print all the options
91 void Print(std::ostream & os = std::cout) const;
92
93 /** non-static methods for setting options */
94
95 /// set print level
96 void SetPrintLevel(int level) { fLevel = level; }
97
98 /// set minimizer type
99 void SetSampler(const char * type) { fSamplerType = type; }
100
101 /// set minimizer algorithm
102 void SetAlgorithm(const char *type) { fAlgoType = type; }
103
104 /// set extra options (in this case pointer is cloned)
105 void SetExtraOptions(const IOptions & opt);
106
107
108private:
109
110 int fLevel; // debug print level
111 std::string fSamplerType; // DistSampler type (Unuran, Foam, etc...)xs
112 std::string fAlgoType; // DistSampler algorithmic specification (for Unuran only)
113
114 // extra options
116
117};
118
119 } // end namespace Math
120
121} // end namespace ROOT
122
123#endif
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
DistSampler options class.
DistSamplerOptions & operator=(const DistSamplerOptions &opt)
assignment operators
int PrintLevel() const
non-static methods for retrivieng options
static void SetDefaultSampler(const char *type)
void SetExtraOptions(const IOptions &opt)
set extra options (in this case pointer is cloned)
void SetAlgorithm(const char *type)
set minimizer algorithm
const std::string & Algorithm() const
type of algorithm
static void SetDefaultPrintLevel(int level)
static void PrintDefault(const char *name, std::ostream &os=std::cout)
print all the default options for the name given
void SetSampler(const char *type)
set minimizer type
ROOT::Math::IOptions * fExtraOptions
static const std::string & DefaultSampler()
const std::string & Sampler() const
type of minimizer
static void SetDefaultAlgorithmND(const char *algo)
IOptions * ExtraOptions() const
return extra options (NULL pointer if they are not present)
static const std::string & DefaultAlgorithmND()
static const std::string & DefaultAlgorithm1D()
static void SetDefaultAlgorithm1D(const char *algo)
static ROOT::Math::IOptions & Default(const char *name)
retrieve extra options - if not existing create a IOptions
static ROOT::Math::IOptions * FindDefault(const char *name)
void SetPrintLevel(int level)
non-static methods for setting options
void Print(std::ostream &os=std::cout) const
print all the options
Generic interface for defining configuration options of a numerical algorithm.
Definition: IOptions.h:30
Namespace for new Math classes and functions.
VSD Structures.
Definition: StringConv.hxx:21