15 #ifndef BORNAGAIN_BASE_AXIS_FIXEDBINAXIS_H
16 #define BORNAGAIN_BASE_AXIS_FIXEDBINAXIS_H
30 FixedBinAxis(
const std::string& name,
size_t nbins,
double start,
double end);
37 double operator[](
size_t index)
const override;
39 Bin1D bin(
size_t index)
const override;
44 double binCenter(
size_t index)
const override {
return (*
this)[index]; }
48 std::vector<double>
binCenters()
const override;
52 void clip(
double lower,
double upper)
override;
55 void print(std::ostream& ostr)
const override;
Axis with fixed bin size.
bool equals(const IAxis &other) const override
void clip(double lower, double upper) override
Clips this axis to the given values.
std::vector< double > binCenters() const override
FixedBinAxis * clone() const override
size_t findClosestIndex(double value) const override
find bin index which is best match for given value
double binCenter(size_t index) const override
void print(std::ostream &ostr) const override
double operator[](size_t index) const override
indexed accessor retrieves a sample
size_t size() const override
Returns the number of bins.
~FixedBinAxis() override=default
double max() const override
Returns value of last point of axis.
Bin1D bin(size_t index) const override
retrieve a 1d bin for the given index
double min() const override
Returns value of first point of axis.
std::vector< double > binBoundaries() const override
FixedBinAxis(const std::string &name, size_t nbins, double start, double end)
FixedBinAxis constructor.
Abstract base class for one-dimensional axes.