11 #ifndef ROOT_Math_GenAlgoOptions 12 #define ROOT_Math_GenAlgoOptions 15 #ifndef ROOT_Math_IOptions 56 if (!pval)
return false;
63 if (!pval)
return false;
70 if (!pval)
return false;
90 virtual void Print(std::ostream & os = std::cout )
const {
118 static const typename M::mapped_type *
FindValue(
const std::string &
name,
const M & opts) {
119 typename M::const_iterator pos;
120 pos = opts.find(name);
121 if (pos == opts.end()) {
124 return &((*pos).second);
128 static void InsertValue(
const std::string &
name, M & opts,
const typename M::mapped_type & value) {
129 typename M::iterator pos;
130 pos = opts.find(name);
131 if (pos != opts.end()) {
135 opts.insert(
typename M::value_type(name, value) );
140 static void Print(
const M & opts, std::ostream & os) {
142 for (
typename M::const_iterator pos = opts.begin(); pos != opts.end(); ++pos)
143 os << std::setw(25) << pos->first <<
" : " << std::setw(15) << pos->second << std::endl;
std::map< std::string, std::string > fNamOpts
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
static const M::mapped_type * FindValue(const std::string &name, const M &opts)
virtual void SetNamedValue(const char *name, const char *val)
virtual bool GetIntValue(const char *name, int &val) const
virtual void Print(std::ostream &os=std::cout) const
print options
static void PrintAllDefault(std::ostream &os=std::cout)
print all the default options
virtual ~GenAlgoOptions()
virtual void SetRealValue(const char *name, double val)
method wich need to be re-implemented by the derived classes
virtual IOptions * Clone() const
generic methods for retrivieng options
std::map< std::string, double > fRealOpts
class implementing generic options for a numerical algorithm Just store the options in a map of strin...
static void Print(const M &opts, std::ostream &os)
static void InsertValue(const std::string &name, M &opts, const typename M::mapped_type &value)
Namespace for new Math classes and functions.
static IOptions & Default(const char *algoname)
virtual bool GetRealValue(const char *name, double &val) const
Generic interface for defining configuration options of a numerical algorithm.
static IOptions * FindDefault(const char *algoname)
std::map< std::string, int > fIntOpts
virtual bool GetNamedValue(const char *name, std::string &val) const
virtual void SetIntValue(const char *name, int val)