// @(#)root/mathcore:$Id$
// Author: L. Moneta Fri Aug 15 2008

/**********************************************************************
 *                                                                    *
 * Copyright (c) 2008  LCG ROOT Math Team, CERN/PH-SFT                *
 *                                                                    *
 *                                                                    *
 **********************************************************************/

#ifndef ROOT_Math_DistSamplerOptions
#define ROOT_Math_DistSamplerOptions

#include <string>

#include <iostream>

namespace ROOT {


namespace Math {


class IOptions;

//_______________________________________________________________________________
/**
    DistSampler options class

    @ingroup NumAlgo
*/
class DistSamplerOptions {

public:

   // static methods for setting and retrieving the default options

   static void SetDefaultSampler(const char * type);
   static void SetDefaultAlgorithm1D(const char * algo );
   static void SetDefaultAlgorithmND(const char * algo );
   static void SetDefaultPrintLevel(int level);

   static const std::string & DefaultSampler();
   static const std::string & DefaultAlgorithm1D();
   static const std::string & DefaultAlgorithmND();
   static int DefaultPrintLevel();

   /// retrieve extra options - if not existing create a IOptions
   static ROOT::Math::IOptions & Default(const char * name);

   // find extra options - return 0 if not existing
   static ROOT::Math::IOptions * FindDefault(const char * name);

   /// print all the default options for the name given
   static void PrintDefault(const char * name, std::ostream & os = std::cout);

public:

   // constructor using the default options
   // pass optionally a pointer to the additional options
   // otherwise look if they exist for this default minimizer
   // and in that case they are copied in the constructed instance
   // constructor takes dimension since a different default algorithm
   // is used if the dimension is 1 or greater than 1
   DistSamplerOptions(int dim = 0);

   // destructor
   ~DistSamplerOptions();

   // copy constructor
   DistSamplerOptions(const DistSamplerOptions & opt);

   /// assignment operators
   DistSamplerOptions & operator=(const DistSamplerOptions & opt);

   /** non-static methods for  retrivieng options */

   /// set print level
   int PrintLevel() const { return fLevel; }

   /// return extra options (NULL pointer if they are not present)
   IOptions * ExtraOptions() const { return fExtraOptions; }

   /// type of minimizer
   const std::string & Sampler() const { return fSamplerType; }

   /// type of algorithm
   const std::string & Algorithm() const { return fAlgoType; }

   /// print all the options
   void Print(std::ostream & os = std::cout) const;

   /** non-static methods for setting options */

   /// set print level
   void SetPrintLevel(int level) { fLevel = level; }

   /// set minimizer type
   void SetSampler(const char * type) { fSamplerType = type; }

   /// set minimizer algorithm
   void SetAlgorithm(const char *type) { fAlgoType = type; }

   /// set extra options (in this case pointer is cloned)
   void  SetExtraOptions(const IOptions & opt);


private:

   int fLevel;               // debug print level
   std::string fSamplerType;   // DistSampler type (Unuran, Foam, etc...)xs
   std::string fAlgoType;    // DistSampler algorithmic specification (for Unuran only)

   // extra options
   ROOT::Math::IOptions *   fExtraOptions;  // extra options

};

   } // end namespace Math

} // end namespace ROOT

#endif
 DistSamplerOptions.h:1
 DistSamplerOptions.h:2
 DistSamplerOptions.h:3
 DistSamplerOptions.h:4
 DistSamplerOptions.h:5
 DistSamplerOptions.h:6
 DistSamplerOptions.h:7
 DistSamplerOptions.h:8
 DistSamplerOptions.h:9
 DistSamplerOptions.h:10
 DistSamplerOptions.h:11
 DistSamplerOptions.h:12
 DistSamplerOptions.h:13
 DistSamplerOptions.h:14
 DistSamplerOptions.h:15
 DistSamplerOptions.h:16
 DistSamplerOptions.h:17
 DistSamplerOptions.h:18
 DistSamplerOptions.h:19
 DistSamplerOptions.h:20
 DistSamplerOptions.h:21
 DistSamplerOptions.h:22
 DistSamplerOptions.h:23
 DistSamplerOptions.h:24
 DistSamplerOptions.h:25
 DistSamplerOptions.h:26
 DistSamplerOptions.h:27
 DistSamplerOptions.h:28
 DistSamplerOptions.h:29
 DistSamplerOptions.h:30
 DistSamplerOptions.h:31
 DistSamplerOptions.h:32
 DistSamplerOptions.h:33
 DistSamplerOptions.h:34
 DistSamplerOptions.h:35
 DistSamplerOptions.h:36
 DistSamplerOptions.h:37
 DistSamplerOptions.h:38
 DistSamplerOptions.h:39
 DistSamplerOptions.h:40
 DistSamplerOptions.h:41
 DistSamplerOptions.h:42
 DistSamplerOptions.h:43
 DistSamplerOptions.h:44
 DistSamplerOptions.h:45
 DistSamplerOptions.h:46
 DistSamplerOptions.h:47
 DistSamplerOptions.h:48
 DistSamplerOptions.h:49
 DistSamplerOptions.h:50
 DistSamplerOptions.h:51
 DistSamplerOptions.h:52
 DistSamplerOptions.h:53
 DistSamplerOptions.h:54
 DistSamplerOptions.h:55
 DistSamplerOptions.h:56
 DistSamplerOptions.h:57
 DistSamplerOptions.h:58
 DistSamplerOptions.h:59
 DistSamplerOptions.h:60
 DistSamplerOptions.h:61
 DistSamplerOptions.h:62
 DistSamplerOptions.h:63
 DistSamplerOptions.h:64
 DistSamplerOptions.h:65
 DistSamplerOptions.h:66
 DistSamplerOptions.h:67
 DistSamplerOptions.h:68
 DistSamplerOptions.h:69
 DistSamplerOptions.h:70
 DistSamplerOptions.h:71
 DistSamplerOptions.h:72
 DistSamplerOptions.h:73
 DistSamplerOptions.h:74
 DistSamplerOptions.h:75
 DistSamplerOptions.h:76
 DistSamplerOptions.h:77
 DistSamplerOptions.h:78
 DistSamplerOptions.h:79
 DistSamplerOptions.h:80
 DistSamplerOptions.h:81
 DistSamplerOptions.h:82
 DistSamplerOptions.h:83
 DistSamplerOptions.h:84
 DistSamplerOptions.h:85
 DistSamplerOptions.h:86
 DistSamplerOptions.h:87
 DistSamplerOptions.h:88
 DistSamplerOptions.h:89
 DistSamplerOptions.h:90
 DistSamplerOptions.h:91
 DistSamplerOptions.h:92
 DistSamplerOptions.h:93
 DistSamplerOptions.h:94
 DistSamplerOptions.h:95
 DistSamplerOptions.h:96
 DistSamplerOptions.h:97
 DistSamplerOptions.h:98
 DistSamplerOptions.h:99
 DistSamplerOptions.h:100
 DistSamplerOptions.h:101
 DistSamplerOptions.h:102
 DistSamplerOptions.h:103
 DistSamplerOptions.h:104
 DistSamplerOptions.h:105
 DistSamplerOptions.h:106
 DistSamplerOptions.h:107
 DistSamplerOptions.h:108
 DistSamplerOptions.h:109
 DistSamplerOptions.h:110
 DistSamplerOptions.h:111
 DistSamplerOptions.h:112
 DistSamplerOptions.h:113
 DistSamplerOptions.h:114
 DistSamplerOptions.h:115
 DistSamplerOptions.h:116
 DistSamplerOptions.h:117
 DistSamplerOptions.h:118
 DistSamplerOptions.h:119
 DistSamplerOptions.h:120
 DistSamplerOptions.h:121
 DistSamplerOptions.h:122
 DistSamplerOptions.h:123