26 " start >= end is not allowed.");
28 double start_sin = std::sin(start);
29 double end_sin = std::sin(end);
30 double step = (end_sin - start_sin) / (
m_nbins - 1);
37 std::vector<double> bin_boundaries;
38 bin_boundaries.resize(
m_nbins + 1, 0.0);
39 for (
size_t i = 0; i < bin_boundaries.size(); ++i) {
40 bin_boundaries[i] = std::asin(start_sin - step / 2. + step * i);
72 ostr <<
"CustomBinAxis(\"" <<
getName() <<
"\", " <<
size() <<
", "
73 << std::setprecision(std::numeric_limits<double>::digits10 + 2) <<
m_start <<
", " <<
m_end
82 if (
size() != otherAxis->size())
Defines and implements namespace algo with some algorithms.
Defines class CustomBinAxis.
Defines many exception classes in namespace Exceptionss.
Axis with fixed bin size in sin(angle) space used for numerical comparison with IsGisaxs.
CustomBinAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
void print(std::ostream &ostr) const
std::vector< double > getBinCenters() const
CustomBinAxis * clone() const
clone function
bool equals(const IAxis &other) const
CustomBinAxis(const std::string &name, size_t nbins, double start, double end)
CustomBinAxis constructor.
std::vector< double > m_bin_centers
Bin1D getBin(size_t index) const
retrieve a 1d bin for the given index
Interface for one-dimensional axes.
virtual bool equals(const IAxis &other) const
std::string getName() const
retrieve the label of the axis
Axis with variable bin size.
size_t size() const
retrieve the number of bins
void setBinBoundaries(const std::vector< double > &bin_boundaries)
bool almostEqual(double a, double b)
Returns true if two doubles agree within machine epsilon.