BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IDistribution1DSampler.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Correlations/IDistribution1DSampler.h
6 //! @brief Defines interface class IFTDistribution1D, 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 #ifndef BORNAGAIN_CORE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
16 #define BORNAGAIN_CORE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
17 
19 {
20 public:
23 
24  virtual double randomSample() const = 0;
25 };
26 
28 {
29 public:
30  Distribution1DCauchySampler(double lambda) : m_lambda(lambda) {}
31  double randomSample() const final;
32 
33 private:
34  double m_lambda;
35 };
36 
38 {
39 public:
40  Distribution1DGaussSampler(double mean, double stddev) : m_mean(mean), m_stddev(stddev) {}
41  double randomSample() const final;
42 
43 private:
44  double m_mean, m_stddev;
45 };
46 
48 {
49 public:
50  Distribution1DGateSampler(double a, double b) : m_a(a), m_b(b) {}
51  double randomSample() const final;
52 
53 private:
54  double m_a, m_b; // the left and right limits of the Gate (Uniform) distribution
55 };
56 
58 {
59 public:
60  Distribution1DTriangleSampler(double omega) : m_omega(omega) {}
61  double randomSample() const final;
62 
63 private:
64  double m_omega; // half the base of the symmetrical Triangle distribution
65 };
66 
68 {
69 public:
70  Distribution1DCosineSampler(double omega) : m_omega(omega) {}
71  double randomSample() const final;
72 
73 private:
74  double m_omega;
75 };
76 
77 #endif // BORNAGAIN_CORE_CORRELATIONS_IDISTRIBUTION1DSAMPLER_H
Distribution1DGateSampler(double a, double b)
Distribution1DGaussSampler(double mean, double stddev)
virtual ~IDistribution1DSampler()
virtual double randomSample() const =0