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

Description

Holds one or two axes.

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
 

Constructor & Destructor Documentation

◆ Frame()

Frame::Frame ( const std::vector< IAxis * > &  axes)

Constructor that takes ownership of supplied axes.

◆ ~Frame()

virtual Frame::~Frame ( )
virtual

Member Function Documentation

◆ allIndices()

std::vector<int> Frame::allIndices ( size_t  i_flat) const

Returns vector of axes indices for given global index.

Parameters
i_flatThe global index of this data structure.
Returns
Vector of bin indices for all axes defined

◆ axis()

const IAxis& Frame::axis ( size_t  k_axis) const

Returns axis with given serial number.

◆ cloned_axes()

std::vector<IAxis*> Frame::cloned_axes ( ) const

Returns cloned axes.

◆ hasSameSizes()

bool Frame::hasSameSizes ( const Frame ) const

Returns true if both Frames have same rank, and all axes have same sizes.

◆ operator==()

bool Frame::operator== ( const Frame ) const

Returns true if both Frames have same rank, and all axes are equal.

◆ projectedCoord()

double Frame::projectedCoord ( size_t  i_flat,
size_t  k_axis 
) const

Returns the value of selected axis for given i_flat.

Parameters
i_flatThe global index of this data structure.
k_axisSerial number of selected axis.
Returns
corresponding bin center of selected axis

◆ projectedIndex()

size_t Frame::projectedIndex ( size_t  i_flat,
size_t  k_axis 
) const

Returns axis bin index for given global index.

Parameters
i_flatThe global index of this data structure.
k_axisSerial number of selected axis.
Returns
Corresponding bin index for selected axis

◆ projectedSize()

size_t Frame::projectedSize ( size_t  k_axis) const

Returns number of bins along axis.

◆ rank()

size_t Frame::rank ( ) const

Returns number of dimensions.

◆ size()

size_t Frame::size ( ) const

Returns total number of bins.

◆ toGlobalIndex()

size_t Frame::toGlobalIndex ( const std::vector< unsigned > &  axes_indices) const

Returns global index for specified indices of axes.

Parameters
axes_indicesVector of axes indices for all specified axes in this dataset
Returns
Corresponding global index

◆ xAxis()

const IAxis& Frame::xAxis ( ) const

◆ yAxis()

const IAxis& Frame::yAxis ( ) const

Member Data Documentation

◆ m_axes

OwningVector<IAxis> Frame::m_axes
protected