BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Public Member Functions | |
Frame (const std::vector< IAxis * > &axes) | |
Constructor that takes ownership of supplied axes. More... | |
virtual | ~Frame () |
std::vector< int > | allIndices (size_t i_flat) const |
Returns vector of axes indices for given global index. More... | |
const IAxis & | axis (size_t k_axis) const |
Returns axis with given serial number. More... | |
std::vector< IAxis * > | cloned_axes () const |
Returns cloned axes. More... | |
bool | hasSameSizes (const Frame &) const |
Returns true if both Frames have same rank, and all axes have same sizes. More... | |
bool | operator== (const Frame &) const |
Returns true if both Frames have same rank, and all axes are equal. More... | |
double | projectedCoord (size_t i_flat, size_t k_axis) const |
Returns the value of selected axis for given i_flat. More... | |
size_t | projectedIndex (size_t i_flat, size_t k_axis) const |
Returns axis bin index for given global index. More... | |
size_t | projectedSize (size_t k_axis) const |
Returns number of bins along axis. More... | |
size_t | rank () const |
Returns number of dimensions. More... | |
size_t | size () const |
Returns total number of bins. More... | |
size_t | toGlobalIndex (const std::vector< unsigned > &axes_indices) const |
Returns global index for specified indices of axes. More... | |
const IAxis & | xAxis () const |
const IAxis & | yAxis () const |
Protected Attributes | |
OwningVector< IAxis > | m_axes |
Private Attributes | |
size_t | m_size |
Frame::Frame | ( | const std::vector< IAxis * > & | axes | ) |
Constructor that takes ownership of supplied axes.
Definition at line 20 of file Frame.cpp.
References ASSERT, axis(), m_size, rank(), size(), and IAxis::size().
|
virtualdefault |
std::vector< int > Frame::allIndices | ( | size_t | i_flat | ) | const |
Returns vector of axes indices for given global index.
i_flat | The global index of this data structure. |
Definition at line 48 of file Frame.cpp.
References projectedIndex(), and rank().
Referenced by DataUtils::Data::createRearrangedDataSet().
|
inline |
Returns axis with given serial number.
Definition at line 46 of file Frame.h.
References OwningVector< T >::at(), and m_axes.
Referenced by Frame(), hasSameSizes(), and operator==().
std::vector< IAxis * > Frame::cloned_axes | ( | ) | const |
Returns cloned axes.
Definition at line 32 of file Frame.cpp.
References OwningVector< T >::cloned_vector(), and m_axes.
Referenced by IDetector::applyDetectorResolution(), and DiffUtil::relativeDifferenceField().
bool Frame::hasSameSizes | ( | const Frame & | o | ) | const |
Returns true if both Frames have same rank, and all axes have same sizes.
Definition at line 102 of file Frame.cpp.
References axis(), rank(), and IAxis::size().
Referenced by Datafield::hasSameSizes().
bool Frame::operator== | ( | const Frame & | o | ) | const |
double Frame::projectedCoord | ( | size_t | i_flat, |
size_t | k_axis | ||
) | const |
Returns the value of selected axis for given i_flat.
i_flat | The global index of this data structure. |
k_axis | Serial number of selected axis. |
Definition at line 42 of file Frame.cpp.
References m_axes, and projectedIndex().
size_t Frame::projectedIndex | ( | size_t | i_flat, |
size_t | k_axis | ||
) | const |
Returns axis bin index for given global index.
i_flat | The global index of this data structure. |
k_axis | Serial number of selected axis. |
Definition at line 56 of file Frame.cpp.
References ASSERT, m_axes, rank(), size(), and OwningVector< T >::size().
Referenced by allIndices(), ConvolutionDetectorResolution::apply2dConvolution(), and projectedCoord().
size_t Frame::projectedSize | ( | size_t | k_axis | ) | const |
|
inline |
Returns number of dimensions.
Definition at line 34 of file Frame.h.
References m_axes, and OwningVector< T >::size().
Referenced by Frame(), allIndices(), hasSameSizes(), operator==(), projectedIndex(), and toGlobalIndex().
|
inline |
Returns total number of bins.
Definition at line 37 of file Frame.h.
References m_size.
Referenced by Frame(), Datafield::normalizedToMaximum(), projectedIndex(), Datafield::size(), and toGlobalIndex().
size_t Frame::toGlobalIndex | ( | const std::vector< unsigned > & | axes_indices | ) | const |
Returns global index for specified indices of axes.
axes_indices | Vector of axes indices for all specified axes in this dataset |
Definition at line 79 of file Frame.cpp.
References ASSERT, m_axes, rank(), size(), and OwningVector< T >::size().
Referenced by IO::readNicosData().
|
inline |
Definition at line 47 of file Frame.h.
References OwningVector< T >::at(), and m_axes.
Referenced by FramUtil::coordinatesFromBinf(), and FramUtil::coordinatesToBinf().
|
inline |
Definition at line 48 of file Frame.h.
References OwningVector< T >::at(), and m_axes.
Referenced by FramUtil::coordinatesFromBinf(), and FramUtil::coordinatesToBinf().
|
protected |
Definition at line 80 of file Frame.h.
Referenced by axis(), cloned_axes(), projectedCoord(), projectedIndex(), projectedSize(), rank(), toGlobalIndex(), xAxis(), and yAxis().
|
private |