File: Sampler.h
template <typename SamplerType>
template <typename Fnc, typename Rnd>
CLASS
Sampler:
Base class:
Public members:
typedef SamplerBin<Sampler> BinType;
typedef std::vector<BinType *> BinVector;
typedef std::vector<double> DVector;
typedef Fnc FncType;
inline Sampler(Rnd & r, long maxN, bool wted = false);
inline void addFunction(int dim, FncType & f);
inline long N() const;
inline long n() const;
inline long nLeft() const;
inline const DVector & generate();
inline void accept();
inline void forceUpdate();
inline void updateMaxInts();
inline void update();
inline double integral();
inline double cutIntegral();
inline double rnd() const;
inline double rnd(double xl, double xu) const;
inline bool rndBool(double x) const;
inline bool rndBool(double x, double y) const;
inline bool rndInt(long x) const;
inline double eps() const;
inline double eps0() const;
inline void eps(double);
inline void eps0(double);
inline const FncType & lastF() const;
inline const DVector & lastPoint() const;
inline int nBins() const;
inline int maxDepth() const;
Private members:
Rnd * theRnd;
The random number generator to be used for this sampler.
long theMaxN;
The requested number of accepted samples (weight > 0);
bool weighted;
If true then generated points are associated with a weight
otherwise all semples hav unity weight.
long theNAcc;
The number of accepted samples (weight > 0) so far.
long theN;
The number of attempted samples so far.
double theEps;
The target efficiency per sampling cell.
double theEps0;
The minimum tolerated efficiency per sampling cell.
DVector theSumMaxInts;
BinVector theFncBins;
The bins representing each function to be sampled and the
accumulated max integrals.
BinType * last;
DVector theLastPoint;
CLASS DECLARATIONS
struct Bas
class SamplerBin
DEFINED MACROS
INCLUDED FILES
vector
SamplerTraits.h
SamplerBin.h
Sampler.icc