15 #ifndef BORNAGAIN_CORE_AXIS_IAXIS_H
16 #define BORNAGAIN_CORE_AXIS_IAXIS_H
37 virtual size_t size()
const = 0;
80 virtual bool contains(
double value)
const;
82 virtual std::string
pyString(
const std::string& units,
size_t offset)
const = 0;
85 virtual void print(std::ostream& ostr)
const = 0;
Defines structs Bin1D, Bin1DCVector.
bool HaveSameNameAndShape(const IAxis &left, const IAxis &right)
global helper function for comparison of axes
Interface for one-dimensional axes.
virtual IAxis * createClippedAxis(double left, double right) const
Creates a new clipped axis.
virtual bool contains(double value) const
Returns true if axis contains given point.
bool operator==(const IAxis &right) const
test for equality
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual Bin1D getBin(size_t index) const =0
retrieve a 1d bin for the given index
IAxis & operator=(const IAxis &)
virtual ~IAxis()
destructor
virtual bool equals(const IAxis &other) const
virtual double getBinCenter(size_t index) const =0
virtual void print(std::ostream &ostr) const =0
void setName(std::string name)
Sets the axis label.
virtual IAxis * clone() const =0
clone function
friend std::ostream & operator<<(std::ostream &ostr, const IAxis &m)
virtual double getMin() const =0
Returns value of first point of axis.
virtual std::vector< double > getBinCenters() const
IAxis(const std::string &name)
constructors
virtual std::string pyString(const std::string &units, size_t offset) const =0
virtual size_t size() const =0
retrieve the number of bins
std::string m_name
axis name
virtual double operator[](size_t index) const =0
indexed accessor retrieves a sample
bool operator!=(const IAxis &right) const
virtual double getMax() const =0
Returns value of last point of axis.
std::string getName() const
retrieve the label of the axis
virtual std::vector< double > getBinBoundaries() const