BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
template<class String , class Vector > | |
PointwiseAxis (String &&name, Vector &&coordinate_values) | |
PointwiseAxis * | clone () const override |
~PointwiseAxis () override=default | |
size_t | size () const override |
double | operator[] (size_t index) const override |
Bin1D | getBin (size_t index) const override |
double | getMin () const override |
double | getMax () const override |
double | getBinCenter (size_t index) const override |
size_t | findClosestIndex (double value) const override |
std::vector< double > | getBinCenters () const override |
std::vector< double > | getBinBoundaries () const override |
PointwiseAxis * | createClippedAxis (double left, double right) const override |
std::string | pyString (const std::string &units, size_t offset) const final |
std::string | getName () const |
void | setName (std::string name) |
bool | operator== (const IAxis &right) const |
bool | operator!= (const IAxis &right) const |
virtual bool | contains (double value) const |
Private Member Functions | |
void | print (std::ostream &ostr) const override |
bool | equals (const IAxis &other) const override |
double | lowerBoundary (size_t index) const |
double | upperBoundary (size_t index) const |
void | checkIndex (size_t index) const |
void | sanityCheck () const |
Private Attributes | |
std::vector< double > | m_coordinates |
std::string | m_name |
Axis containing arbitrary (non-equidistant) coordinate values.
Lower boundary of the first bin and upper boundary of the last bin correspond to first and last passed coordinates. Other bin boundaries are computed as arithmetical mean of two adjacent coordinates. One should be aware, that bin centers reported by PointwiseAxis::getBinCenter do not coincide with the values produced by Bin1D::getMidPoint. On-axis values are bounded by minimum/maximum values passed to the constructor.
Definition at line 32 of file PointwiseAxis.h.
|
inline |
Definition at line 36 of file PointwiseAxis.h.
References sanityCheck().
Referenced by clone(), and createClippedAxis().
|
overridedefault |
|
overridevirtual |
clone function
Implements IAxis.
Definition at line 23 of file PointwiseAxis.cpp.
References IAxis::getName(), m_coordinates, and PointwiseAxis().
|
inlineoverridevirtual |
retrieve the number of bins
Implements IAxis.
Definition at line 48 of file PointwiseAxis.h.
References m_coordinates.
|
inlineoverridevirtual |
indexed accessor retrieves a sample
Implements IAxis.
Definition at line 51 of file PointwiseAxis.h.
References getBinCenter().
|
overridevirtual |
retrieve a 1d bin for the given index
Implements IAxis.
Definition at line 28 of file PointwiseAxis.cpp.
References checkIndex(), lowerBoundary(), and upperBoundary().
|
overridevirtual |
Returns value of first on-axis point.
Implements IAxis.
Definition at line 34 of file PointwiseAxis.cpp.
References lowerBoundary().
|
overridevirtual |
Returns value of last on-axis point.
Implements IAxis.
Definition at line 39 of file PointwiseAxis.cpp.
References m_coordinates, and upperBoundary().
|
overridevirtual |
Returns the coordinate corresponding to the given index.
Implements IAxis.
Definition at line 44 of file PointwiseAxis.cpp.
References checkIndex(), and m_coordinates.
Referenced by operator[]().
|
overridevirtual |
find index of the coordinate closest to the given value
Implements IAxis.
Definition at line 50 of file PointwiseAxis.cpp.
References lowerBoundary(), and m_coordinates.
Referenced by createClippedAxis().
|
inlineoverridevirtual |
Reimplemented from IAxis.
Definition at line 69 of file PointwiseAxis.h.
References m_coordinates.
Referenced by pyString().
|
overridevirtual |
Reimplemented from IAxis.
Definition at line 63 of file PointwiseAxis.cpp.
References lowerBoundary(), m_coordinates, and upperBoundary().
|
overridevirtual |
Creates a new clipped axis.
Reimplemented from IAxis.
Definition at line 74 of file PointwiseAxis.cpp.
References findClosestIndex(), IAxis::getName(), m_coordinates, and PointwiseAxis().
|
finalvirtual |
Implements IAxis.
Definition at line 87 of file PointwiseAxis.cpp.
References getBinCenters(), pyfmt::indent(), and pyfmt::printValue().
|
overrideprivatevirtual |
Implements IAxis.
Definition at line 102 of file PointwiseAxis.cpp.
References IAxis::getName(), m_coordinates, and anonymous_namespace{OutputDataWriteStrategy.cpp}::precision.
|
overrideprivatevirtual |
Reimplemented from IAxis.
Definition at line 112 of file PointwiseAxis.cpp.
References IAxis::equals(), and m_coordinates.
|
private |
Definition at line 121 of file PointwiseAxis.cpp.
References m_coordinates.
Referenced by findClosestIndex(), getBin(), getBinBoundaries(), and getMin().
|
private |
Definition at line 128 of file PointwiseAxis.cpp.
References m_coordinates.
Referenced by getBin(), getBinBoundaries(), and getMax().
|
private |
Definition at line 135 of file PointwiseAxis.cpp.
References m_coordinates.
Referenced by getBin(), and getBinCenter().
|
private |
Definition at line 145 of file PointwiseAxis.cpp.
References m_coordinates, and min_axis_size.
Referenced by PointwiseAxis().
|
inlineinherited |
retrieve the label of the axis
Definition at line 40 of file IAxis.h.
References IAxis::m_name.
Referenced by OutputData< T >::addAxis(), RegionOfInterest::clipAxisToRoi(), CustomBinAxis::clone(), FixedBinAxis::clone(), VariableBinAxis::clone(), ConstKBinAxis::clone(), clone(), FixedBinAxis::createClippedAxis(), VariableBinAxis::createClippedAxis(), ConstKBinAxis::createClippedAxis(), createClippedAxis(), IAxis::equals(), CustomBinAxis::print(), FixedBinAxis::print(), VariableBinAxis::print(), ConstKBinAxis::print(), print(), and FixedBinAxis::pyString().
|
inlineinherited |
|
inlineinherited |
test for equality
Definition at line 63 of file IAxis.h.
References IAxis::equals().
|
inlineinherited |
|
virtualinherited |
Returns true if axis contains given point.
Definition at line 40 of file IAxis.cpp.
References IAxis::getMax(), and IAxis::getMin().
Referenced by Histogram1D::crop(), Histogram2D::crop(), RectangularDetector::indexOfSpecular(), and SphericalDetector::indexOfSpecular().
|
private |
Definition at line 87 of file PointwiseAxis.h.
Referenced by checkIndex(), clone(), createClippedAxis(), equals(), findClosestIndex(), getBinBoundaries(), getBinCenter(), getBinCenters(), getMax(), lowerBoundary(), print(), sanityCheck(), size(), and upperBoundary().
|
privateinherited |
axis name
Definition at line 92 of file IAxis.h.
Referenced by IAxis::getName(), and IAxis::setName().