16 #ifndef BORNAGAIN_BASE_AXIS_POINTWISEAXIS_H
17 #define BORNAGAIN_BASE_AXIS_POINTWISEAXIS_H
35 template <
class String,
class Vector>
37 :
IAxis(std::forward<String>(name))
55 Bin1D bin(
size_t index)
const override;
58 double min()
const override;
61 double max()
const override;
66 double binCenter(
size_t index)
const override;
75 void clip(
double lower,
double upper)
override;
78 void print(std::ostream& ostr)
const override;
81 double minary(
size_t index)
const;
82 double maxary(
size_t index)
const;
Abstract base class for one-dimensional axes.
Axis containing arbitrary (non-equidistant) coordinate values. Lower boundary of the first bin and up...
~PointwiseAxis() override
PointwiseAxis(String &&name, Vector &&coordinate_values)
PointwiseAxis * clone() const override
clone function
double min() const override
Returns value of first on-axis point.
double binCenter(size_t index) const override
Returns the coordinate corresponding to the given index. For this type of axis ("pointwise") this equ...
Bin1D bin(size_t index) const override
retrieve a 1d bin for the given index
void checkIndex(size_t index) const
std::vector< double > m_coordinates
size_t findClosestIndex(double value) const override
find index of the coordinate closest to the given value
std::vector< double > binBoundaries() const override
double operator[](size_t index) const override
indexed accessor retrieves a sample
void clip(double lower, double upper) override
Clips this axis to the given values.
double maxary(size_t index) const
double minary(size_t index) const
size_t size() const override
retrieve the number of bins
bool equals(const IAxis &other) const override
std::vector< double > binCenters() const override
void print(std::ostream &ostr) const override
double max() const override
Returns value of last on-axis point.