BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
IDistribution1DSampler.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Correlations/IDistribution1DSampler.h
6 //! @brief Defines interface class IProfile1D, and children thereof
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
21 #define BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
22 
24 public:
27 
28  virtual double randomSample() const = 0;
29 };
30 
32 public:
34  : m_lambda(lambda)
35  {
36  }
37  double randomSample() const override;
38 
39 private:
40  double m_lambda;
41 };
42 
44 public:
45  Distribution1DGaussSampler(double mean, double stddev)
46  : m_mean(mean)
47  , m_stddev(stddev)
48  {
49  }
50  double randomSample() const override;
51 
52 private:
53  double m_mean, m_stddev;
54 };
55 
57 public:
58  Distribution1DGateSampler(double a, double b)
59  : m_a(a)
60  , m_b(b)
61  {
62  }
63  double randomSample() const override;
64 
65 private:
66  double m_a, m_b; // the left and right limits of the Gate (Uniform) distribution
67 };
68 
70 public:
72  : m_omega(omega)
73  {
74  }
75  double randomSample() const override;
76 
77 private:
78  double m_omega; // half the base of the symmetrical Triangle distribution
79 };
80 
82 public:
84  : m_omega(omega)
85  {
86  }
87  double randomSample() const override;
88 
89 private:
90  double m_omega;
91 };
92 
93 #endif // BORNAGAIN_SAMPLE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
94 #endif // USER_API
double randomSample() const override
double randomSample() const override
Distribution1DGateSampler(double a, double b)
double randomSample() const override
Distribution1DGaussSampler(double mean, double stddev)
double randomSample() const override
double randomSample() const override
IDistribution1DSampler()=default
virtual ~IDistribution1DSampler()
virtual double randomSample() const =0