npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
AbsInterpolationAlgoND.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_ABSINTERPOLATIONALGOND_HH_
2 #define NPSTAT_ABSINTERPOLATIONALGOND_HH_
3 
4 /*!
5 // \file AbsInterpolationAlgoND.hh
6 //
7 // \brief Interface for multidimensional interpolation between densities
8 //
9 // Author: I. Volobouev
10 //
11 // June 2015
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  inline explicit AbsInterpolationAlgoND(const unsigned dim)
22 
23  inline virtual ~AbsInterpolationAlgoND() {}
24 
25  virtual AbsInterpolationAlgoND* clone() const = 0;
26 
27  virtual unsigned size() const = 0;
28 
29  virtual void add(const AbsDistributionND& d, double w) = 0;
30  virtual void replace(unsigned i, const AbsDistributionND& d, double w)=0;
31  virtual void setWeight(unsigned i, double w) = 0;
32  virtual void clear() = 0;
33  virtual void normalizeAutomatically(bool allow) = 0;
34 
35  protected:
36  struct WeightedND
37  {
38  inline WeightedND(const AbsDistributionND* id, const double iw)
39  : d(id), w(iw) {}
40 
41  inline WeightedND(const AbsDistributionND& id, const double iw)
42  : d(&id), w(iw) {}
43 
44  inline bool operator==(const WeightedND& r) const
45  {return *d == *r.d && w == r.w;}
46  inline bool operator!=(const WeightedND& r) const
47  {return !(*this == r);}
48 
49  const AbsDistributionND* d;
50  double w;
51 
52  private:
53  WeightedND();
54  };
55  };
56 }
57 
58 #endif // NPSTAT_ABSINTERPOLATIONALGOND_HH_
Interface definition for multivariate continuous statistical distributions.
Definition: AbsDistributionND.hh:26
unsigned dim() const
Definition: AbsDistributionND.hh:51
Definition: AbsInterpolationAlgoND.hh:18
virtual AbsInterpolationAlgoND * clone() const =0
Definition: AbsArrayProjector.hh:14
Definition: AbsInterpolationAlgoND.hh:37