BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
VariableBinAxis Class Reference

Axis with variable bin size. More...

+ Inheritance diagram for VariableBinAxis:

Public Member Functions

 VariableBinAxis (const std::string &name, size_t nbins, const std::vector< double > &bin_boundaries)
 VariableBinAxis constructor. More...
 
Bin1D bin (size_t index) const
 
std::vector< double > binBoundaries () const
 
double binCenter (size_t index) const
 
std::vector< double > binCenters () const
 
VariableBinAxisclone () const
 
virtual VariableBinAxiscreateClippedAxis (double left, double right) const
 
size_t findClosestIndex (double value) const
 
double lowerBound () const
 
double operator[] (size_t index) const
 
size_t size () const
 
double upperBound () const
 

Protected Member Functions

 VariableBinAxis (const std::string &name, size_t nbins=0)
 
virtual bool equals (const IAxis &other) const
 
virtual void print (std::ostream &ostr) const
 
void setBinBoundaries (const std::vector< double > &bin_boundaries)
 

Protected Attributes

size_t m_nbins
 

Detailed Description

Axis with variable bin size.

Constructor & Destructor Documentation

◆ VariableBinAxis()

VariableBinAxis::VariableBinAxis ( const std::string &  name,
size_t  nbins,
const std::vector< double > &  bin_boundaries 
)

VariableBinAxis constructor.

Parameters
nameAxis name
nbinsnumber of bins
bin_boundariesArray of size nbins+1 containing low-edges for each bin and upper edge of last bin.