15 #ifndef BORNAGAIN_CORE_AXIS_POINTWISEAXIS_H
16 #define BORNAGAIN_CORE_AXIS_POINTWISEAXIS_H
35 template <
class String,
class Vector>
37 :
IAxis(std::forward<String>(name)), m_coordinates(std::forward<Vector>(coordinate_values))
48 size_t size()
const override {
return m_coordinates.size(); }
57 double getMin()
const override;
60 double getMax()
const override;
69 std::vector<double> getBinCenters()
const override {
return m_coordinates; }
71 std::vector<double> getBinBoundaries()
const override;
76 std::string pyString(
const std::string& units,
size_t offset)
const final;
79 void print(std::ostream& ostr)
const override;
80 bool equals(
const IAxis& other)
const override;
82 double lowerBoundary(
size_t index)
const;
83 double upperBoundary(
size_t index)
const;
84 void checkIndex(
size_t index)
const;
85 void sanityCheck()
const;
87 std::vector<double> m_coordinates;
Interface for one-dimensional axes.
IAxis(const std::string &name)
constructors
Axis containing arbitrary (non-equidistant) coordinate values.
Bin1D getBin(size_t index) const override
retrieve a 1d bin for the given index
PointwiseAxis * clone() const override
clone function
double getBinCenter(size_t index) const override
Returns the coordinate corresponding to the given index.
PointwiseAxis * createClippedAxis(double left, double right) const override
Creates a new clipped axis.
double getMax() const override
Returns value of last on-axis point.
size_t findClosestIndex(double value) const override
find index of the coordinate closest to the given value
double operator[](size_t index) const override
indexed accessor retrieves a sample
size_t size() const override
retrieve the number of bins
double getMin() const override
Returns value of first on-axis point.