15 #ifndef BORNAGAIN_CORE_AXIS_FIXEDBINAXIS_H
16 #define BORNAGAIN_CORE_AXIS_FIXEDBINAXIS_H
31 FixedBinAxis(
const std::string& name,
size_t nbins,
double start,
double end);
36 size_t size()
const {
return m_nbins; }
42 double getMin()
const {
return m_start; }
43 double getMax()
const {
return m_end; }
45 double getBinCenter(
size_t index)
const {
return (*
this)[index]; }
49 std::vector<double> getBinCenters()
const;
51 std::vector<double> getBinBoundaries()
const;
55 std::string pyString(
const std::string& units,
size_t)
const final;
58 void print(std::ostream& ostr)
const;
59 virtual bool equals(
const IAxis& other)
const;
Axis with fixed bin size.
FixedBinAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
double operator[](size_t index) const
indexed accessor retrieves a sample
size_t findClosestIndex(double value) const
find bin index which is best match for given value
double getMax() const
Returns value of last point of axis.
FixedBinAxis * clone() const
clone function
double getMin() const
Returns value of first point of axis.
FixedBinAxis(const std::string &name, size_t nbins, double start, double end)
FixedBinAxis constructor.
size_t size() const
retrieve the number of bins
Bin1D getBin(size_t index) const
retrieve a 1d bin for the given index
Interface for one-dimensional axes.