npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
AbsInterpolatedDistribution1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_ABSINTERPOLATEDDISTRIBUTION1D_HH_
2 #define NPSTAT_ABSINTERPOLATEDDISTRIBUTION1D_HH_
3 
4 /*!
5 // \file AbsInterpolatedDistribution1D.hh
6 //
7 // \brief Interface for interpolating 1-d distributions
8 //
9 // Author: I. Volobouev
10 //
11 // July 2015
12 */
13 
15 
16 namespace npstat {
18  {
19  public:
20  inline virtual ~AbsInterpolatedDistribution1D() {}
21 
22  /** "Virtual copy constructor" */
23  virtual AbsInterpolatedDistribution1D* clone() const = 0;
24 
25  /** Add a new distribution */
26  virtual void add(const AbsDistribution1D& d, double weight) = 0;
27 
28  /** Replace an existing distribution */
29  virtual void replace(unsigned i, const AbsDistribution1D& d,
30  double weight) = 0;
31 
32  /** Modify the weight for an existing dostribution */
33  virtual void setWeight(unsigned i, double weight) = 0;
34 
35  /** Clear all distributions */
36  virtual void clear() = 0;
37 
38  /** The number of distributions participating in the interpolation */
39  virtual unsigned size() const = 0;
40 
41  /**
42  // The number of distributions expected to participate
43  // in the interpolation
44  */
45  virtual unsigned expectedSize() const = 0;
46 
47  /**
48  // The following function should be called to disable
49  // (and later enable) automatic weight normalization
50  // if you want to use the "setWeight" or "replace" methods
51  // many times and, especially, if at some point in this process
52  // the sum of the weights becomes zero. The "density" method
53  // can not be called if normalization is not enabled.
54  */
55  virtual void normalizeAutomatically(bool allow) = 0;
56  };
57 }
58 
59 #endif // NPSTAT_ABSINTERPOLATEDDISTRIBUTION1D_HH_
Interface definition for 1-d continuous statistical distributions.
Definition: AbsInterpolatedDistribution1D.hh:18
virtual unsigned size() const =0
virtual AbsInterpolatedDistribution1D * clone() const =0
virtual void replace(unsigned i, const AbsDistribution1D &d, double weight)=0
virtual unsigned expectedSize() const =0
virtual void add(const AbsDistribution1D &d, double weight)=0
virtual void setWeight(unsigned i, double weight)=0
virtual void normalizeAutomatically(bool allow)=0
Definition: AbsArrayProjector.hh:14
Definition: AbsDistribution1D.hh:31