BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Bin.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Axis/Bin.h
6 //! @brief Defines structs Bin1D, Bin1DCVector
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_BASE_AXIS_BIN_H
16 #define BORNAGAIN_BASE_AXIS_BIN_H
17 
18 #include <heinz/Vectors3D.h>
19 
20 class Bin1D {
21 public:
22  Bin1D() = default;
23  Bin1D(double lower, double upper)
24  : m_lower(lower)
25  , m_upper(upper)
26  {
27  }
28  double m_lower{0}; //!< lower bound of the bin
29  double m_upper{0}; //!< upper bound of the bin
30  double center() const { return (m_lower + m_upper) / 2.0; }
31  double binSize() const { return m_upper - m_lower; }
32 };
33 
34 #endif // BORNAGAIN_BASE_AXIS_BIN_H
Definition: Bin.h:20
double center() const
Definition: Bin.h:30
double binSize() const
Definition: Bin.h:31
Bin1D(double lower, double upper)
Definition: Bin.h:23
Bin1D()=default
double m_upper
upper bound of the bin
Definition: Bin.h:29
double m_lower
lower bound of the bin
Definition: Bin.h:28