BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
VariableBinAxis Class Reference

Description

Axis with variable bin size.

Inheritance diagram for VariableBinAxis:

Public Member Functions

 VariableBinAxis (const std::string &name, const std::vector< double > &bin_boundaries)
 VariableBinAxis constructor. More...
 
 ~VariableBinAxis () override=default
 
Bin1D bin (size_t index) const override
 
std::vector< double > binBoundaries () const override
 
double binCenter (size_t index) const override
 
std::vector< double > binCenters () const override
 
void clip (double lower, double upper) override
 
VariableBinAxisclone () const override
 
size_t findClosestIndex (double value) const override
 
double max () const override
 
double min () const override
 
double operator[] (size_t index) const override
 
size_t size () const override
 

Protected Member Functions

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

Protected Attributes

size_t m_nbins
 

Constructor & Destructor Documentation

◆ VariableBinAxis() [1/2]

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

VariableBinAxis constructor.

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

◆ ~VariableBinAxis()

VariableBinAxis::~VariableBinAxis ( )
overridedefault

◆ VariableBinAxis() [2/2]

VariableBinAxis::VariableBinAxis ( const std::string &  name,
size_t  nbins = 0 
)
explicitprotected

Member Function Documentation

◆ bin()

Bin1D VariableBinAxis::bin ( size_t  index) const
override

◆ binBoundaries()

std::vector<double> VariableBinAxis::binBoundaries ( ) const
override

◆ binCenter()

double VariableBinAxis::binCenter ( size_t  index) const
override

◆ binCenters()

std::vector<double> VariableBinAxis::binCenters ( ) const
override

◆ clip()

void VariableBinAxis::clip ( double  lower,
double  upper 
)
override

◆ clone()

VariableBinAxis* VariableBinAxis::clone ( ) const
override

◆ equals()

bool VariableBinAxis::equals ( const IAxis &  other) const
overrideprotected

◆ findClosestIndex()

size_t VariableBinAxis::findClosestIndex ( double  value) const
override

◆ max()

double VariableBinAxis::max ( ) const
override

◆ min()

double VariableBinAxis::min ( ) const
override

◆ operator[]()

double VariableBinAxis::operator[] ( size_t  index) const
override

◆ print()

void VariableBinAxis::print ( std::ostream &  ostr) const
overrideprotected

◆ setBinBoundaries()

void VariableBinAxis::setBinBoundaries ( const std::vector< double > &  bin_boundaries)
protected

◆ size()

size_t VariableBinAxis::size ( ) const
override

Member Data Documentation

◆ m_nbins

size_t VariableBinAxis::m_nbins
protected