BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Types | |
using | value_type = T |
typedef OutputDataIterator< T, OutputData< T > > | iterator |
typedef OutputDataIterator< const T, const OutputData< T > > | const_iterator |
Public Member Functions | |
OutputData () | |
OutputData (const OutputData &)=delete | |
const OutputData & | operator= (const OutputData &)=delete |
~OutputData () | |
OutputData * | clone () const |
void | copyFrom (const OutputData< T > &x) |
template<class U > | |
void | copyShapeFrom (const OutputData< U > &other) |
OutputData< double > * | meanValues () const |
void | addAxis (const IAxis &new_axis) |
void | addAxis (const std::string &name, size_t size, double start, double end) |
const IAxis & | getAxis (size_t serial_number) const |
const IAxis & | getAxis (const std::string &axis_name) const |
size_t | getRank () const |
size_t | getAllocatedSize () const |
std::vector< size_t > | getAllSizes () const |
std::vector< T > | getRawDataVector () const |
T | totalSum () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
std::vector< int > | getAxesBinIndices (size_t global_index) const |
size_t | getAxisBinIndex (size_t global_index, size_t i_selected_axis) const |
size_t | getAxisBinIndex (size_t global_index, const std::string &axis_name) const |
size_t | toGlobalIndex (const std::vector< unsigned > &axes_indices) const |
size_t | findGlobalIndex (const std::vector< double > &coordinates) const |
double | getAxisValue (size_t global_index, size_t i_selected_axis) const |
double | getAxisValue (size_t global_index, const std::string &axis_name) const |
std::vector< double > | getAxesValues (size_t global_index) const |
Bin1D | getAxisBin (size_t global_index, size_t i_selected_axis) const |
Bin1D | getAxisBin (size_t global_index, const std::string &axis_name) const |
void | clear () |
void | setAllTo (const T &value) |
void | scaleAll (const T &factor) |
void | setAxisSizes (size_t rank, int *n_dims) |
void | setRawDataVector (const std::vector< T > &data_vector) |
void | setRawDataArray (const T *source) |
const OutputData< T > & | operator+= (const OutputData< T > &right) |
const OutputData< T > & | operator-= (const OutputData< T > &right) |
const OutputData< T > & | operator/= (const OutputData< T > &right) |
const OutputData< T > & | operator*= (const OutputData< T > &right) |
double | getValue (size_t index) const |
T & | operator[] (size_t index) |
const T & | operator[] (size_t index) const |
template<class U > | |
bool | hasSameDimensions (const OutputData< U > &right) const |
template<class U > | |
bool | hasSameShape (const OutputData< U > &right) const |
PyObject * | getArray () const |
bool | isInitialized () const |
void | allocate () |
Private Member Functions | |
size_t | getAxisIndex (const std::string &axis_name) const |
bool | axisNameExists (const std::string &axis_name) const |
Private Attributes | |
SafePointerVector< IAxis > | m_value_axes |
LLData< T > * | mp_ll_data |
Friends | |
class | OutputDataIterator< T, OutputData< T > > |
class | OutputDataIterator< const T, const OutputData< T > > |
Template class to store data of any type in multi-dimensional space.
Definition at line 32 of file OutputData.h.
using OutputData< T >::value_type = T |
Definition at line 35 of file OutputData.h.
typedef OutputDataIterator<T, OutputData<T> > OutputData< T >::iterator |
Read/write iterator type.
Definition at line 84 of file OutputData.h.
typedef OutputDataIterator<const T, const OutputData<T> > OutputData< T >::const_iterator |
Read-only iterator type.
Definition at line 87 of file OutputData.h.
OutputData< T >::OutputData |
Definition at line 242 of file OutputData.h.
References OutputData< T >::allocate().
|
delete |
OutputData< T >::~OutputData |
Definition at line 247 of file OutputData.h.
|
delete |
OutputData< T > * OutputData< T >::clone |
Definition at line 253 of file OutputData.h.
References OutputData< T >::m_value_axes, and OutputData< T >::mp_ll_data.
Referenced by IntensityDataFunctions::createRearrangedDataSet(), IntensityDataFunctions::createRelativeDifferenceData(), and OffSpecSimulation::result().
void OutputData< T >::copyFrom | ( | const OutputData< T > & | x | ) |
Definition at line 261 of file OutputData.h.
References OutputData< T >::m_value_axes, and OutputData< T >::mp_ll_data.
Referenced by DetectorMask::DetectorMask(), IHistogram::IHistogram(), OffSpecSimulation::OffSpecSimulation(), and DetectorMask::operator=().
void OutputData< T >::copyShapeFrom | ( | const OutputData< U > & | other | ) |
Definition at line 271 of file OutputData.h.
References OutputData< T >::getAxis(), and OutputData< T >::getRank().
Referenced by DetectorMask::createHistogram(), IHistogram::createOutputData(), and IHistogram::init_from_data().
OutputData< double > * OutputData< T >::meanValues |
Definition at line 279 of file OutputData.h.
Referenced by IntensityDataFunctions::getRelativeDifference().
void OutputData< T >::addAxis | ( | const IAxis & | new_axis | ) |
Definition at line 289 of file OutputData.h.
References IAxis::clone(), IAxis::getName(), and IAxis::size().
Referenced by Histogram1D::Histogram1D(), Histogram2D::Histogram2D(), IHistogram::IHistogram(), Histogram2D::initFromShape(), DetectorMask::initMaskData(), OutputDataReadINTStrategy::readOutputData(), OutputDataReadReflectometryStrategy::readOutputData(), SpecularSimulation::result(), OffSpecSimulation::transferDetectorImage(), and OffSpecSimulation::updateIntensityMap().
void OutputData< T >::addAxis | ( | const std::string & | name, |
size_t | size, | ||
double | start, | ||
double | end | ||
) |
Definition at line 303 of file OutputData.h.
const IAxis & OutputData< T >::getAxis | ( | size_t | serial_number | ) | const |
returns axis with given serial number
Definition at line 314 of file OutputData.h.
Referenced by Histogram2D::addContent(), ConvolutionDetectorResolution::apply1dConvolution(), ConvolutionDetectorResolution::apply2dConvolution(), IntensityDataFunctions::coordinateFromBinf(), IntensityDataFunctions::coordinateToBinf(), OutputData< T >::copyShapeFrom(), IntensityDataFunctions::create2DArrayfromOutputData(), IntensityDataFunctions::createClippedDataSet(), IntensityDataFunctions::createRearrangedDataSet(), anonymous_namespace{Simulation.cpp}::detHasSameDimensions(), IHistogram::getXaxis(), IHistogram::getYaxis(), OutputData< T >::hasSameDimensions(), OutputData< T >::hasSameShape(), DetectorMask::initMaskData(), RegionOfInterest::RegionOfInterest(), anonymous_namespace{OutputDataWriteStrategy.cpp}::Write1DRepresentation(), anonymous_namespace{OutputDataWriteStrategy.cpp}::Write2DRepresentation(), and OutputDataWriteINTStrategy::writeOutputData().
const IAxis & OutputData< T >::getAxis | ( | const std::string & | axis_name | ) | const |
returns axis with given name
Definition at line 319 of file OutputData.h.
|
inline |
Returns number of dimensions.
Definition at line 59 of file OutputData.h.
References OutputData< T >::m_value_axes, and SafePointerVector< T >::size().
Referenced by ConvolutionDetectorResolution::apply1dConvolution(), ConvolutionDetectorResolution::apply2dConvolution(), ConvolutionDetectorResolution::applyDetectorResolution(), OutputData< T >::copyShapeFrom(), IntensityDataFunctions::create2DArrayfromOutputData(), IntensityDataFunctions::createClippedDataSet(), IUnitConverter::createConvertedData(), UnitConverter1D::createConvertedData(), IHistogram::createHistogram(), IntensityDataFunctions::createRearrangedDataSet(), anonymous_namespace{Simulation.cpp}::detHasSameDimensions(), OutputData< T >::hasSameDimensions(), IHistogram::init_from_data(), DetectorMask::initMaskData(), RegionOfInterest::RegionOfInterest(), OutputDataWriteINTStrategy::writeOutputData(), and OutputDataWriteNumpyTXTStrategy::writeOutputData().
|
inline |
Returns total size of data buffer (product of bin number in every dimension).
Definition at line 62 of file OutputData.h.
References OutputData< T >::mp_ll_data.
Referenced by DetectorMask::createHistogram(), IntensityDataFunctions::createRearrangedDataSet(), OutputData< T >::end(), IntensityDataFunctions::getRelativeDifference(), IHistogram::getTotalNumberOfBins(), IHistogram::init_from_data(), DetectorMask::process_masks(), OffSpecSimulation::transferDetectorImage(), and OffSpecSimulation::transferResultsToIntensityMap().
|
inline |
|
inline |
Returns copy of raw data vector.
Definition at line 335 of file OutputData.h.
References ASSERT.
Referenced by ConvolutionDetectorResolution::apply1dConvolution(), ConvolutionDetectorResolution::apply2dConvolution(), Simulation::convertData(), IUnitConverter::createConvertedData(), and UnitConverter1D::createConvertedData().
|
inline |
Returns sum of all values in the data structure.
Definition at line 467 of file OutputData.h.
References ASSERT.
OutputData< T >::iterator OutputData< T >::begin |
Returns read/write iterator that points to the first element.
Definition at line 344 of file OutputData.h.
Referenced by ConvolutionDetectorResolution::apply2dConvolution(), IntensityDataFunctions::createClippedDataSet(), Histogram1D::crop(), Histogram2D::crop(), DataFormatUtils::fillOutputData(), IHistogram::getMaximum(), IHistogram::getMaximumBinIndex(), IHistogram::getMinimum(), IHistogram::getMinimumBinIndex(), and anonymous_namespace{OutputDataWriteStrategy.cpp}::WriteOutputDataDoubles().
OutputData< T >::const_iterator OutputData< T >::begin |
Returns read-only iterator that points to the first element.
Definition at line 350 of file OutputData.h.
|
inline |
Returns read/write iterator that points to the one past last element.
Definition at line 96 of file OutputData.h.
References OutputData< T >::getAllocatedSize().
Referenced by ConvolutionDetectorResolution::apply2dConvolution(), IntensityDataFunctions::createClippedDataSet(), Histogram1D::crop(), Histogram2D::crop(), DataFormatUtils::fillOutputData(), IHistogram::getMaximum(), IHistogram::getMaximumBinIndex(), IHistogram::getMinimum(), IHistogram::getMinimumBinIndex(), and anonymous_namespace{OutputDataWriteStrategy.cpp}::WriteOutputDataDoubles().
|
inline |
Returns read-only iterator that points to the one past last element.
Definition at line 99 of file OutputData.h.
References OutputData< T >::getAllocatedSize().
std::vector< int > OutputData< T >::getAxesBinIndices | ( | size_t | global_index | ) | const |
Returns vector of axes indices for given global index.
global_index | The global index of this data structure. |
Definition at line 356 of file OutputData.h.
References ASSERT.
Referenced by IntensityDataFunctions::createRearrangedDataSet().
size_t OutputData< T >::getAxisBinIndex | ( | size_t | global_index, |
size_t | i_selected_axis | ||
) | const |
Returns axis bin index for given global index.
global_index | The global index of this data structure. |
i_selected_axis | Serial number of selected axis. |
Definition at line 371 of file OutputData.h.
References ASSERT.
Referenced by IHistogram::getXaxisIndex(), and IHistogram::getYaxisIndex().
size_t OutputData< T >::getAxisBinIndex | ( | size_t | global_index, |
const std::string & | axis_name | ||
) | const |
Returns axis bin index for given global index.
global_index | The global index of this data structure. |
axis_name | The name of selected axis. |
Definition at line 387 of file OutputData.h.
size_t OutputData< T >::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 393 of file OutputData.h.
References ASSERT.
Referenced by IHistogram::getGlobalBin().
size_t OutputData< T >::findGlobalIndex | ( | const std::vector< double > & | coordinates | ) | const |
Returns global index for specified axes values.
coordinates | Vector of axes coordinates for all specified axes in this dataset |
Definition at line 418 of file OutputData.h.
References ASSERT.
Referenced by Histogram2D::fill(), and IHistogram::findGlobalBin().
double OutputData< T >::getAxisValue | ( | size_t | global_index, |
size_t | i_selected_axis | ||
) | const |
Returns the value of selected axis for given global_index.
global_index | The global index of this data structure. |
i_selected_axis | Serial number of selected axis. |
Definition at line 433 of file OutputData.h.
Referenced by IntensityDataFunctions::createClippedDataSet(), Histogram1D::crop(), Histogram2D::crop(), IHistogram::getXaxisValue(), and IHistogram::getYaxisValue().
double OutputData< T >::getAxisValue | ( | size_t | global_index, |
const std::string & | axis_name | ||
) | const |
Returns the value of selected axis for given global_index.
global_index | The global index of this data structure. |
axis_name | The name of selected axis. |
Definition at line 440 of file OutputData.h.
std::vector< double > OutputData< T >::getAxesValues | ( | size_t | global_index | ) | const |
Returns values on all defined axes for given globalbin number.
global_index | The global index of this data structure. |
Definition at line 445 of file OutputData.h.
Bin1D OutputData< T >::getAxisBin | ( | size_t | global_index, |
size_t | i_selected_axis | ||
) | const |
Returns bin of selected axis for given global_index.
global_index | The global index of this data structure. |
i_selected_axis | Serial number of selected axis. |
Definition at line 455 of file OutputData.h.
Referenced by DetectorMask::process_masks().
Bin1D OutputData< T >::getAxisBin | ( | size_t | global_index, |
const std::string & | axis_name | ||
) | const |
Returns bin of selected axis for given global_index.
global_index | The global index of this data structure. |
axis_name | The name of selected axis. |
Definition at line 462 of file OutputData.h.
void OutputData< T >::clear |
Sets object into initial state (no dimensions, data)
Definition at line 473 of file OutputData.h.
Referenced by DetectorMask::addMask(), DetectorMask::initMaskData(), DetectorMask::removeMasks(), and OffSpecSimulation::updateIntensityMap().
void OutputData< T >::setAllTo | ( | const T & | value | ) |
Sets content of output data to specific value.
Definition at line 479 of file OutputData.h.
Referenced by DataFormatUtils::fillOutputData(), DetectorMask::process_masks(), IHistogram::reset(), SpecularSimulation::result(), and OffSpecSimulation::updateIntensityMap().
void OutputData< T >::scaleAll | ( | const T & | factor | ) |
void OutputData< T >::setAxisSizes | ( | size_t | rank, |
int * | n_dims | ||
) |
Adds 'rank' axes with indicated sizes.
Definition at line 495 of file OutputData.h.
|
inline |
Sets new values to raw data vector.
Definition at line 559 of file OutputData.h.
Referenced by ConvolutionDetectorResolution::apply1dConvolution(), IDetector::applyDetectorResolution(), OutputDataReadReflectometryStrategy::readOutputData(), and SpecularSimulation::result().
|
inline |
Sets new values to raw data array.
Definition at line 569 of file OutputData.h.
const OutputData< T > & OutputData< T >::operator+= | ( | const OutputData< T > & | right | ) |
addition-assignment operator for two output data
Definition at line 506 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
const OutputData< T > & OutputData< T >::operator-= | ( | const OutputData< T > & | right | ) |
substraction-assignment operator for two output data
Definition at line 513 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
const OutputData< T > & OutputData< T >::operator/= | ( | const OutputData< T > & | right | ) |
division-assignment operator for two output data
Definition at line 538 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
const OutputData< T > & OutputData< T >::operator*= | ( | const OutputData< T > & | right | ) |
multiplication-assignment operator for two output data
Definition at line 520 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
double OutputData< T >::getValue | ( | size_t | index | ) | const |
Returns value or summed value, depending on T.
|
inline |
indexed accessor
Definition at line 195 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
|
inline |
indexed accessor (const)
Definition at line 202 of file OutputData.h.
References ASSERT, and OutputData< T >::mp_ll_data.
|
inline |
Returns true if object have same dimensions and number of axes bins.
Returns true if object have same dimensions.
Definition at line 578 of file OutputData.h.
References OutputData< T >::getAxis(), OutputData< T >::getRank(), OutputData< T >::isInitialized(), and IAxis::size().
Referenced by IntensityDataFunctions::createRelativeDifferenceData(), IntensityDataFunctions::getRelativeDifference(), and IHistogram::hasSameDimensions().
bool OutputData< T >::hasSameShape | ( | const OutputData< U > & | right | ) | const |
Returns true if objects a) have same dimensions b) bin boundaries of axes coincide.
Returns true if object have same dimensions and shape of axis.
Definition at line 595 of file OutputData.h.
References OutputData< T >::getAxis(), and HaveSameNameAndShape().
Referenced by IHistogram::hasSameShape().
PyObject* OutputData< T >::getArray | ( | ) | const |
returns data as Python numpy array
bool OutputData< T >::isInitialized |
returns true if object is correctly initialized
Definition at line 527 of file OutputData.h.
Referenced by OutputData< T >::hasSameDimensions().
void OutputData< T >::allocate |
memory allocation for current dimensions configuration
Definition at line 545 of file OutputData.h.
Referenced by OutputData< T >::OutputData().
|
private |
|
private |
|
friend |
Definition at line 76 of file OutputData.h.
|
friend |
Definition at line 76 of file OutputData.h.
|
private |
Definition at line 234 of file OutputData.h.
Referenced by OutputData< T >::clone(), OutputData< T >::copyFrom(), and OutputData< T >::getRank().
|
private |
Definition at line 235 of file OutputData.h.
Referenced by OutputData< T >::clone(), OutputData< T >::copyFrom(), OutputData< T >::getAllocatedSize(), OutputData< T >::operator*=(), OutputData< T >::operator+=(), OutputData< T >::operator-=(), OutputData< T >::operator/=(), and OutputData< T >::operator[]().