11#ifndef ROOT_Math_GenAlgoOptions
12#define ROOT_Math_GenAlgoOptions
56 if (!pval)
return false;
63 if (!pval)
return false;
70 if (!pval)
return false;
89 std::vector<std::string> names;
93 names.push_back(
e.first);
97 std::vector<std::string> names;
101 names.push_back(
e.first);
105 std::vector<std::string> names;
109 names.push_back(
e.first);
114 virtual void Print(std::ostream & os = std::cout )
const {
142 static const typename M::mapped_type *
FindValue(
const std::string &
name,
const M & opts) {
143 typename M::const_iterator pos;
144 pos = opts.find(
name);
145 if (pos == opts.end()) {
148 return &((*pos).second);
152 static void InsertValue(
const std::string &
name, M & opts,
const typename M::mapped_type & value) {
153 typename M::iterator pos;
154 pos = opts.find(
name);
155 if (pos != opts.end()) {
159 opts.insert(
typename M::value_type(
name, value) );
164 static void Print(
const M & opts, std::ostream & os) {
166 for (
typename M::const_iterator pos = opts.begin(); pos != opts.end(); ++pos)
167 os << std::setw(25) << pos->first <<
" : " << std::setw(15) << pos->second << std::endl;
class implementing generic options for a numerical algorithm Just store the options in a map of strin...
std::map< std::string, double > fRealOpts
std::vector< std::string > GetAllRealKeys()
static void Print(const M &opts, std::ostream &os)
virtual ~GenAlgoOptions()
std::map< std::string, int > fIntOpts
static void PrintAllDefault(std::ostream &os=std::cout)
print all the default options
static void InsertValue(const std::string &name, M &opts, const typename M::mapped_type &value)
virtual void Print(std::ostream &os=std::cout) const
print options
virtual void SetRealValue(const char *name, double val)
method wich need to be re-implemented by the derived classes
virtual void SetIntValue(const char *name, int val)
virtual bool GetIntValue(const char *name, int &val) const
virtual IOptions * Clone() const
generic methods for retrivieng options
static IOptions & Default(const char *algoname)
static const M::mapped_type * FindValue(const std::string &name, const M &opts)
static IOptions * FindDefault(const char *algoname)
std::vector< std::string > GetAllIntKeys()
std::map< std::string, std::string > fNamOpts
virtual void SetNamedValue(const char *name, const char *val)
std::vector< std::string > GetAllNamedKeys()
virtual bool GetNamedValue(const char *name, std::string &val) const
virtual bool GetRealValue(const char *name, double &val) const
Generic interface for defining configuration options of a numerical algorithm.
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...