diff --git a/Device/Coord/CoordSystem1D.cpp b/Device/Coord/CoordSystem1D.cpp index e783f632a968280adc18117567dad6507c867280..a8405a88bc547675fe2ea34716b7979e99e5493a 100644 --- a/Device/Coord/CoordSystem1D.cpp +++ b/Device/Coord/CoordSystem1D.cpp @@ -141,7 +141,7 @@ CoordSystem1D::createConvertedData(const Powerfield<double>& data, Axes::Coords return result; } - for (size_t i = 0, size = result->getAllocatedSize(); i < size; ++i) + for (size_t i = 0, size = result->allocatedSize(); i < size; ++i) (*result)[i] = data[i] * std::pow((*q_axis)[i], 4); return result; } diff --git a/Device/Data/DataUtils.cpp b/Device/Data/DataUtils.cpp index 4a0080b05f96be89311950e58827cac4ffa1609f..6b9ca950ef4cff37212547ecaa2cca826f8b4013 100644 --- a/Device/Data/DataUtils.cpp +++ b/Device/Data/DataUtils.cpp @@ -40,9 +40,9 @@ double DataUtils::Data::relativeDataDifference(const Powerfield<double>& dat, throw std::runtime_error("Powerfield dimension differs from reference"); double diff = 0.0; - for (size_t i = 0; i < dat.getAllocatedSize(); ++i) + for (size_t i = 0; i < dat.allocatedSize(); ++i) diff += Numeric::GetRelativeDifference(dat[i], ref[i]); - diff /= dat.getAllocatedSize(); + diff /= dat.allocatedSize(); if (std::isnan(diff)) throw std::runtime_error("diff=NaN"); return diff; @@ -56,7 +56,7 @@ DataUtils::Data::createRelativeDifferenceData(const Powerfield<double>& data, throw std::runtime_error("DataUtils::Data::createRelativeDifferenceData() -> " "Error. Different dimensions of data and reference."); std::unique_ptr<Powerfield<double>> result(reference.clone()); - for (size_t i = 0; i < result->getAllocatedSize(); ++i) + for (size_t i = 0; i < result->allocatedSize(); ++i) (*result)[i] = Numeric::GetRelativeDifference(data[i], reference[i]); return result; } @@ -97,7 +97,7 @@ DataUtils::Data::createRearrangedDataSet(const Powerfield<double>& data, int n) }; } - for (size_t index = 0, size = data.getAllocatedSize(); index < size; ++index) { + for (size_t index = 0, size = data.allocatedSize(); index < size; ++index) { std::vector<int> axis_inds = data.getAxesBinIndices(index); index_mapping(axis_inds); size_t output_index = output->toGlobalIndex( diff --git a/Device/Data/Powerfield.cpp b/Device/Data/Powerfield.cpp index c01305eb8cb815aacc00768cf4652f7f8ab4abff..b48ef2b49628389e535cefa725dc6423af5bb5d9 100644 --- a/Device/Data/Powerfield.cpp +++ b/Device/Data/Powerfield.cpp @@ -158,14 +158,14 @@ PyObject* Powerfield<double>::getArray() const // filling numpy array with output_data if (rank() == 2) { - for (size_t index = 0; index < getAllocatedSize(); ++index) { + for (size_t index = 0; index < allocatedSize(); ++index) { std::vector<int> axes_indices = getAxesBinIndices(index); size_t offset = axes_indices[0] + m_axes[0]->size() * (m_axes[1]->size() - 1 - axes_indices[1]); array_buffer[offset] = (*this)[index]; } } else { - for (size_t index = 0; index < getAllocatedSize(); ++index) + for (size_t index = 0; index < allocatedSize(); ++index) *array_buffer++ = (*this)[index]; } diff --git a/Device/Data/Powerfield.h b/Device/Data/Powerfield.h index 90f22e30866b9137ed43b76486a81ada823e0ca1..32c2ebe3b5849f14d7df044d40ffeb0005844b7b 100644 --- a/Device/Data/Powerfield.h +++ b/Device/Data/Powerfield.h @@ -138,7 +138,7 @@ public: // retrieve basic info //! Returns total size of data buffer (product of bin number in every dimension). - size_t getAllocatedSize() const + size_t allocatedSize() const { if (m_ll_data) return m_ll_data->getTotalSize(); @@ -169,10 +169,10 @@ public: const_iterator begin() const; //! Returns read/write iterator that points to the one past last element - iterator end() { return iterator(this, getAllocatedSize()); } + iterator end() { return iterator(this, allocatedSize()); } //! Returns read-only iterator that points to the one past last element - const_iterator end() const { return const_iterator(this, getAllocatedSize()); } + const_iterator end() const { return const_iterator(this, allocatedSize()); } // coordinate and index functions @@ -357,7 +357,7 @@ inline std::vector<T> Powerfield<T>::getRawDataVector() const { ASSERT(m_ll_data); std::vector<T> result; - for (size_t i = 0; i < getAllocatedSize(); ++i) + for (size_t i = 0; i < allocatedSize(); ++i) result.push_back((*m_ll_data)[i]); return result; } @@ -458,15 +458,15 @@ void Powerfield<T>::allocate() template <class T> inline void Powerfield<T>::setRawDataVector(const std::vector<T>& data_vector) { - ASSERT(data_vector.size() == getAllocatedSize()); - for (size_t i = 0; i < getAllocatedSize(); ++i) + ASSERT(data_vector.size() == allocatedSize()); + for (size_t i = 0; i < allocatedSize(); ++i) (*m_ll_data)[i] = data_vector[i]; } template <class T> inline void Powerfield<T>::setRawDataArray(const T* source) { - for (size_t i = 0; i < getAllocatedSize(); ++i) + for (size_t i = 0; i < allocatedSize(); ++i) (*m_ll_data)[i] = source[i]; } diff --git a/Device/Data/PowerfieldIterator.h b/Device/Data/PowerfieldIterator.h index 7c7f4bd587a9fdc3799cbb7755380a258a365766..d5d691506c86aef0a36da4139dd1548ba31fb2ac 100644 --- a/Device/Data/PowerfieldIterator.h +++ b/Device/Data/PowerfieldIterator.h @@ -169,7 +169,7 @@ PowerfieldIterator<TValue, TContainer>::~PowerfieldIterator() = default; template <class TValue, class TContainer> PowerfieldIterator<TValue, TContainer>& PowerfieldIterator<TValue, TContainer>::operator++() { - if (m_current_index < m_output_data->getAllocatedSize()) { + if (m_current_index < m_output_data->allocatedSize()) { ++m_current_index; } return *this; diff --git a/Device/Histo/IHistogram.cpp b/Device/Histo/IHistogram.cpp index dd8ab28a25426aa5780f16e74520db353d0d1de4..581d43f8f2fd63430a28253c04ea2e9265a50592 100644 --- a/Device/Histo/IHistogram.cpp +++ b/Device/Histo/IHistogram.cpp @@ -37,7 +37,7 @@ IHistogram::IHistogram(const IAxis& axis_x, const IAxis& axis_y) size_t IHistogram::getTotalNumberOfBins() const { - return m_data.getAllocatedSize(); + return m_data.allocatedSize(); } const IAxis& IHistogram::xAxis() const @@ -276,7 +276,7 @@ void IHistogram::init_from_data(const Powerfield<double>& source) } m_data.copyShapeFrom(source); - for (size_t i = 0; i < source.getAllocatedSize(); ++i) + for (size_t i = 0; i < source.allocatedSize(); ++i) m_data[i].add(source[i]); } diff --git a/Device/Histo/SimulationResult.cpp b/Device/Histo/SimulationResult.cpp index e7dff16840ff21fc1693879941362f0850d7f549..a7357ede09fd7737a7934921bb44cb8adbdace4c 100644 --- a/Device/Histo/SimulationResult.cpp +++ b/Device/Histo/SimulationResult.cpp @@ -103,7 +103,7 @@ const double& SimulationResult::operator[](size_t i) const size_t SimulationResult::size() const { - return m_data ? m_data->getAllocatedSize() : 0; + return m_data ? m_data->allocatedSize() : 0; } SimulationResult SimulationResult::relativeToMaximum() const diff --git a/Device/Mask/DetectorMask.cpp b/Device/Mask/DetectorMask.cpp index aede37399f16834f34552fcd1806410a563a2842..12cd1767ad33aee75dd210d82b3a2d259d204e01 100644 --- a/Device/Mask/DetectorMask.cpp +++ b/Device/Mask/DetectorMask.cpp @@ -106,7 +106,7 @@ void DetectorMask::process_masks() return; m_number_of_masked_channels = 0; - for (size_t index = 0; index < m_masked->getAllocatedSize(); ++index) { + for (size_t index = 0; index < m_masked->allocatedSize(); ++index) { Bin1D binx = m_masked->getAxisBin(index, 0); Bin1D biny = m_masked->getAxisBin(index, 1); // setting mask to the data starting from last shape added diff --git a/GUI/Model/Data/DataItem.cpp b/GUI/Model/Data/DataItem.cpp index f43eac1603e1e3544c0e68b290d42927313e594c..0554b635bc2e3d5887c4cb16b49acfc6528249c3 100644 --- a/GUI/Model/Data/DataItem.cpp +++ b/GUI/Model/Data/DataItem.cpp @@ -25,7 +25,7 @@ void DataItem::setPowerfield(Powerfield<double>* data) void DataItem::setRawDataVector(std::vector<double> data) { - if (m_data->getAllocatedSize() != data.size()) + if (m_data->allocatedSize() != data.size()) throw Error("DataItem::setRawDataVector() -> Error. " "Different data size."); std::unique_lock<std::mutex> lock(m_update_data_mutex); diff --git a/GUI/View/Loaders/AutomaticDataLoader1DResultModel.cpp b/GUI/View/Loaders/AutomaticDataLoader1DResultModel.cpp index a0264674f5cea8f3fa3830fb30c767d309a3e523..e4088f7062b280b457da9ec188a44f3de46a8a27 100644 --- a/GUI/View/Loaders/AutomaticDataLoader1DResultModel.cpp +++ b/GUI/View/Loaders/AutomaticDataLoader1DResultModel.cpp @@ -32,7 +32,7 @@ int AutomaticDataLoader1DResultModel::rowCount() const if (!data) return 0; - return int(data->getAllocatedSize()); + return int(data->allocatedSize()); } bool AutomaticDataLoader1DResultModel::rowIsSkipped(int /*row*/) const diff --git a/GUI/View/Mask/MaskResultsPresenter.cpp b/GUI/View/Mask/MaskResultsPresenter.cpp index 0ac5c4cebdd0a4426a9e95af963dfbc9656905b4..3d3952bdb0f716450741181a99db210b0c52663c 100644 --- a/GUI/View/Mask/MaskResultsPresenter.cpp +++ b/GUI/View/Mask/MaskResultsPresenter.cpp @@ -110,7 +110,7 @@ Powerfield<double>* MaskResultsPresenter::createMaskPresentation() const if (!detectorMask.hasMasks()) return nullptr; - for (size_t i = 0; i < result->getAllocatedSize(); ++i) + for (size_t i = 0; i < result->allocatedSize(); ++i) if (detectorMask.isMasked(i)) (*result)[i] = 0.0; diff --git a/GUI/View/PlotSpecular/SpecularPlot.cpp b/GUI/View/PlotSpecular/SpecularPlot.cpp index 11f98cf5967803f97625b13f206ff1a641748b39..51eff799080f989139f74fb283333edc7d5671c9 100644 --- a/GUI/View/PlotSpecular/SpecularPlot.cpp +++ b/GUI/View/PlotSpecular/SpecularPlot.cpp @@ -241,7 +241,7 @@ void SpecularPlot::setDataFromItem(SpecularDataItem* item) if (!data) return; - for (size_t i = 0, size = data->getAllocatedSize(); i < size; ++i) { + for (size_t i = 0, size = data->allocatedSize(); i < size; ++i) { double x = data->getAxisValue(i, 0); double y = data->operator[](i); m_custom_plot->graph()->addData(x, y); diff --git a/Sim/Simulation/OffSpecularSimulation.cpp b/Sim/Simulation/OffSpecularSimulation.cpp index 9266661d006a12a3e0749150d20b3bf74e9653a3..3017368053cead5fdf7cf5ef4962d7b6eac32a10 100644 --- a/Sim/Simulation/OffSpecularSimulation.cpp +++ b/Sim/Simulation/OffSpecularSimulation.cpp @@ -51,7 +51,7 @@ SimulationResult OffSpecularSimulation::pack_result() checkInitialization(); const IAxis& phi_axis = detector().axis(0); size_t phi_f_size = phi_axis.size(); - ASSERT(phi_f_size * m_intensity_map.getAllocatedSize() == m_eles.size()); + ASSERT(phi_f_size * m_intensity_map.allocatedSize() == m_eles.size()); for (size_t i = 0; i < m_alpha_i_axis->size(); ++i) transferDetectorImage(i); @@ -148,7 +148,7 @@ void OffSpecularSimulation::transferDetectorImage(size_t index) size_t detector_dimension = detector().dimension(); for (size_t dim = 0; dim < detector_dimension; ++dim) detector_image.addAxis(detector().axis(dim)); - size_t detector_size = detector_image.getAllocatedSize(); + size_t detector_size = detector_image.allocatedSize(); for (size_t i = 0; i < detector_size; ++i) detector_image[i] = m_eles[index * detector_size + i]->intensity(); detector().applyDetectorResolution(&detector_image); diff --git a/Tests/Functional/Core/CoreSpecial/CoreIOPathTest.cpp b/Tests/Functional/Core/CoreSpecial/CoreIOPathTest.cpp index 74de88a6a5e7edbf141a8ffa3866049bdc1529cf..5299a5095611a8d0e86cdf1fc6560af0d13103b8 100644 --- a/Tests/Functional/Core/CoreSpecial/CoreIOPathTest.cpp +++ b/Tests/Functional/Core/CoreSpecial/CoreIOPathTest.cpp @@ -27,7 +27,7 @@ std::unique_ptr<Powerfield<double>> createTestData() { std::unique_ptr<Powerfield<double>> result(new Powerfield<double>); result->addAxis("x", 10, 0.0, 10.0); - for (size_t i = 0; i < result->getAllocatedSize(); ++i) + for (size_t i = 0; i < result->allocatedSize(); ++i) (*result)[i] = static_cast<double>(i); return result; } diff --git a/Tests/PyUnit/intensitydata.py b/Tests/PyUnit/intensitydata.py index 5fe2935e96de62b0e72ab5af224cedcc30ad3652..b3ef6dcf4295753fe5d9f5b319838d5e1e91d7a7 100644 --- a/Tests/PyUnit/intensitydata.py +++ b/Tests/PyUnit/intensitydata.py @@ -12,7 +12,7 @@ class IntensityDataTest(unittest.TestCase): def test_empty_data(self): data = ba.IntensityData() - self.assertEqual(1, data.getAllocatedSize()) + self.assertEqual(1, data.allocatedSize()) self.assertEqual(0, data.rank()) self.assertEqual(0, data.totalSum()) @@ -37,7 +37,7 @@ class IntensityDataTest(unittest.TestCase): self.assertEqual(20, axis0.upperBound()) data = ba.IntensityData() data.addAxis(axis0) - self.assertEqual(20, data.getAllocatedSize()) + self.assertEqual(20, data.allocatedSize()) self.assertEqual(1, data.rank()) self.assertEqual(0, data.totalSum()) @@ -45,7 +45,7 @@ class IntensityDataTest(unittest.TestCase): data = ba.IntensityData() data.addAxis("axis0", 10, 0, 10) data.addAxis("axis1", 20, 0, 20) - self.assertEqual(200, data.getAllocatedSize()) + self.assertEqual(200, data.allocatedSize()) self.assertEqual(2, data.rank()) self.assertEqual(0, data.totalSum()) data.setAllTo(1) diff --git a/Tests/PyUnit/intensitydata_io.py b/Tests/PyUnit/intensitydata_io.py index 8a088805474c8efdff7ff21ca5b1614228a1dc3f..0a1af8a2510c8c50699febca0e0625189a68d407 100644 --- a/Tests/PyUnit/intensitydata_io.py +++ b/Tests/PyUnit/intensitydata_io.py @@ -9,14 +9,14 @@ def is_the_same_data(data1, data2): """ Checks if two data are identical """ - if data1.getAllocatedSize() != data2.getAllocatedSize(): + if data1.allocatedSize() != data2.allocatedSize(): return False if data1.rank() != data2.rank(): return False for i in range(0, data1.rank()): if data1.axis(i) != data2.axis(i): return False - for i in range(0, data1.getAllocatedSize()): + for i in range(0, data1.allocatedSize()): if data1[i] != data2[i]: return False return True diff --git a/Tests/Unit/Device/ArrayUtilsTest.cpp b/Tests/Unit/Device/ArrayUtilsTest.cpp index c3ce27f34f25aae010a3f1ebba8d9f76a6a315b0..2bd34746b97c8610c6b1b65f7276f485f5ac2d0e 100644 --- a/Tests/Unit/Device/ArrayUtilsTest.cpp +++ b/Tests/Unit/Device/ArrayUtilsTest.cpp @@ -11,7 +11,7 @@ TEST_F(ArrayUtilsTest, PowerfieldFromVector1D) const std::vector<double> vec_double = {10.0, 20.0, 30.0, 40.0}; auto data1 = DataUtils::Array::createData(vec_double); - EXPECT_EQ(data1->getAllocatedSize(), vec_double.size()); + EXPECT_EQ(data1->allocatedSize(), vec_double.size()); EXPECT_EQ(data1->getRawDataVector(), vec_double); EXPECT_EQ(data1->axis(0).lowerBound(), 0.0); EXPECT_EQ(data1->axis(0).upperBound(), 4.0); @@ -26,7 +26,7 @@ TEST_F(ArrayUtilsTest, PowerfieldToVector1D) auto vec = DataUtils::Array::createVector1D(data); - EXPECT_EQ(vec.size(), data.getAllocatedSize()); + EXPECT_EQ(vec.size(), data.allocatedSize()); EXPECT_EQ(vec, expected); } @@ -37,7 +37,7 @@ TEST_F(ArrayUtilsTest, PowerfieldFromVector2D) auto data = DataUtils::Array::createData(vec_double); EXPECT_EQ(data->rank(), 2u); - EXPECT_EQ(data->getAllocatedSize(), 12u); + EXPECT_EQ(data->allocatedSize(), 12u); EXPECT_EQ(data->axis(0).size(), 4u); EXPECT_EQ(data->axis(0).lowerBound(), 0.0); EXPECT_EQ(data->axis(0).upperBound(), 4.0); diff --git a/Tests/Unit/Device/DetectorMaskTest.cpp b/Tests/Unit/Device/DetectorMaskTest.cpp index 540de4a0724f45f895051e250ea03199d61a8515..ba05a903bb293531f1430aabfb13f0b98ae8dd27 100644 --- a/Tests/Unit/Device/DetectorMaskTest.cpp +++ b/Tests/Unit/Device/DetectorMaskTest.cpp @@ -48,7 +48,7 @@ TEST_F(DetectorMaskTest, AddMask) EXPECT_TRUE(detectorMask.getMaskData()->isInitialized()); - for (size_t index = 0; index < detectorMask.getMaskData()->getAllocatedSize(); ++index) { + for (size_t index = 0; index < detectorMask.getMaskData()->allocatedSize(); ++index) { double x = detectorMask.getMaskData()->getAxisValue(index, 0); double y = detectorMask.getMaskData()->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) @@ -63,7 +63,7 @@ TEST_F(DetectorMaskTest, AddMask) detectorMask.addMask(polygon, false); detectorMask.initMaskData(detector.axis(0), detector.axis(1)); - for (size_t index = 0; index < detectorMask.getMaskData()->getAllocatedSize(); ++index) + for (size_t index = 0; index < detectorMask.getMaskData()->allocatedSize(); ++index) EXPECT_FALSE(detectorMask.isMasked(index)); EXPECT_EQ(detectorMask.numberOfMaskedChannels(), 0); @@ -73,7 +73,7 @@ TEST_F(DetectorMaskTest, AddMask) Polygon polygon2(x, y); detectorMask.addMask(polygon2, true); detectorMask.initMaskData(detector.axis(0), detector.axis(1)); - for (size_t index = 0; index < detectorMask.getMaskData()->getAllocatedSize(); ++index) { + for (size_t index = 0; index < detectorMask.getMaskData()->allocatedSize(); ++index) { double x = detectorMask.getMaskData()->getAxisValue(index, 0); double y = detectorMask.getMaskData()->getAxisValue(index, 1); if (x >= 5.0 && x <= 8.0 && y >= 2.0 && y <= 4.0) @@ -103,7 +103,7 @@ TEST_F(DetectorMaskTest, AssignmentOperator) EXPECT_TRUE(mask.getMaskData()->isInitialized()); - for (size_t index = 0; index < mask.getMaskData()->getAllocatedSize(); ++index) { + for (size_t index = 0; index < mask.getMaskData()->allocatedSize(); ++index) { double x = mask.getMaskData()->getAxisValue(index, 0); double y = mask.getMaskData()->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) @@ -134,7 +134,7 @@ TEST_F(DetectorMaskTest, CopyConstructor) EXPECT_TRUE(mask.getMaskData()->isInitialized()); - for (size_t index = 0; index < mask.getMaskData()->getAllocatedSize(); ++index) { + for (size_t index = 0; index < mask.getMaskData()->allocatedSize(); ++index) { double x = mask.getMaskData()->getAxisValue(index, 0); double y = mask.getMaskData()->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) diff --git a/Tests/Unit/Device/Histogram1DTest.cpp b/Tests/Unit/Device/Histogram1DTest.cpp index db2c2bca70e3b12a2d2e53f85d5278ac714f962f..afb1e6478780a30e872795ccaca6ae0569f4f7fb 100644 --- a/Tests/Unit/Device/Histogram1DTest.cpp +++ b/Tests/Unit/Device/Histogram1DTest.cpp @@ -129,12 +129,12 @@ TEST_F(Histogram1DTest, CreateHistogram) { Powerfield<double> data; data.addAxis("x-axis", 10, 0.0, 10.0); - for (size_t i = 0; i < data.getAllocatedSize(); ++i) + for (size_t i = 0; i < data.allocatedSize(); ++i) data[i] = double(i); std::unique_ptr<IHistogram> hist(IHistogram::createHistogram(data)); EXPECT_EQ(size_t(1), hist->rank()); - EXPECT_EQ(data.getAllocatedSize(), hist->getNbinsX()); + EXPECT_EQ(data.allocatedSize(), hist->getNbinsX()); EXPECT_EQ(data.axis(0).lowerBound(), hist->xMin()); EXPECT_EQ(data.axis(0).upperBound(), hist->xMax()); for (size_t i = 0; i < hist->getTotalNumberOfBins(); ++i) { @@ -156,22 +156,22 @@ TEST_F(Histogram1DTest, CreatePowerfield) std::unique_ptr<Powerfield<double>> data(hist.createPowerfield(IHistogram::DataType::INTEGRAL)); EXPECT_EQ(size_t(1), data->rank()); - EXPECT_EQ(data->getAllocatedSize(), hist.getNbinsX()); + EXPECT_EQ(data->allocatedSize(), hist.getNbinsX()); EXPECT_EQ(data->axis(0).lowerBound(), hist.xMin()); EXPECT_EQ(data->axis(0).upperBound(), hist.xMax()); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(4.0, (*data)[i]); data.reset(hist.createPowerfield(IHistogram::DataType::AVERAGE)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(2.0, (*data)[i]); data.reset(hist.createPowerfield(IHistogram::DataType::STANDARD_ERROR)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(1.0, (*data)[i]); data.reset(hist.createPowerfield(IHistogram::DataType::NENTRIES)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(2.0, (*data)[i]); } diff --git a/Tests/Unit/Device/Histogram2DTest.cpp b/Tests/Unit/Device/Histogram2DTest.cpp index f61957b9af99a39d05f451add63b85d580c02f83..0b47580a099387aee75422c45308681fdbb85a98 100644 --- a/Tests/Unit/Device/Histogram2DTest.cpp +++ b/Tests/Unit/Device/Histogram2DTest.cpp @@ -335,12 +335,12 @@ TEST_F(Histogram2DTest, CreateHistogram) Powerfield<double> data; data.addAxis("x-axis", 10, 0.0, 10.0); data.addAxis("y-axis", 5, -5.0, 0.0); - for (size_t i = 0; i < data.getAllocatedSize(); ++i) + for (size_t i = 0; i < data.allocatedSize(); ++i) data[i] = double(i); std::unique_ptr<IHistogram> h2(IHistogram::createHistogram(data)); EXPECT_EQ(size_t(2), h2->rank()); - EXPECT_EQ(data.getAllocatedSize(), h2->getTotalNumberOfBins()); + EXPECT_EQ(data.allocatedSize(), h2->getTotalNumberOfBins()); EXPECT_EQ(data.axis(0).lowerBound(), h2->xMin()); EXPECT_EQ(data.axis(0).upperBound(), h2->xMax()); EXPECT_EQ(data.axis(1).lowerBound(), h2->yMin()); @@ -367,24 +367,24 @@ TEST_F(Histogram2DTest, CreatePowerfield) std::unique_ptr<Powerfield<double>> data(h2.createPowerfield(IHistogram::DataType::INTEGRAL)); EXPECT_EQ(size_t(2), data->rank()); - EXPECT_EQ(data->getAllocatedSize(), h2.getTotalNumberOfBins()); + EXPECT_EQ(data->allocatedSize(), h2.getTotalNumberOfBins()); EXPECT_EQ(data->axis(0).lowerBound(), h2.xMin()); EXPECT_EQ(data->axis(0).upperBound(), h2.xMax()); EXPECT_EQ(data->axis(1).lowerBound(), h2.yMin()); EXPECT_EQ(data->axis(1).upperBound(), h2.yMax()); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(double(i), (*data)[i]); data.reset(h2.createPowerfield(IHistogram::DataType::AVERAGE)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(double(i), (*data)[i]); data.reset(h2.createPowerfield(IHistogram::DataType::STANDARD_ERROR)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(0.0, (*data)[i]); data.reset(h2.createPowerfield(IHistogram::DataType::NENTRIES)); - for (size_t i = 0; i < data->getAllocatedSize(); ++i) + for (size_t i = 0; i < data->allocatedSize(); ++i) EXPECT_EQ(1.0, (*data)[i]); } diff --git a/Tests/Unit/Device/IOReaderWriterTest.cpp b/Tests/Unit/Device/IOReaderWriterTest.cpp index c5f1685a10ef3347f4006a209e07c2f80bdef38b..7711c1cf95217f5279481d73c72588c6aecacf01 100644 --- a/Tests/Unit/Device/IOReaderWriterTest.cpp +++ b/Tests/Unit/Device/IOReaderWriterTest.cpp @@ -16,7 +16,7 @@ IOReaderWriterTest::IOReaderWriterTest() FixedBinAxis axis2("y", 10, 6.0, 7.0); m_model_data.addAxis(axis1); m_model_data.addAxis(axis2); - for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) + for (size_t i = 0, size = m_model_data.allocatedSize(); i < size; ++i) m_model_data[i] = static_cast<double>(i); } @@ -37,7 +37,7 @@ TEST_F(IOReaderWriterTest, TestRWINT) EXPECT_EQ(m_model_data.rank(), result->rank()); compare_axis(0); compare_axis(1); - for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) + for (size_t i = 0, size = m_model_data.allocatedSize(); i < size; ++i) EXPECT_EQ(m_model_data[i], (*result)[i]); } @@ -50,7 +50,7 @@ TEST_F(IOReaderWriterTest, TestRWNumpyTXT) ReadWriteNumpyTXT read_txt; auto result = std::unique_ptr<Powerfield<double>>(read_txt.readPowerfield(ss)); EXPECT_EQ(m_model_data.rank(), result->rank()); - for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) + for (size_t i = 0, size = m_model_data.allocatedSize(); i < size; ++i) EXPECT_EQ(m_model_data[i], (*result)[i]); } @@ -65,7 +65,7 @@ TEST_F(IOReaderWriterTest, TestRWTiff) ReadWriteTiff read_tiff; auto result = std::unique_ptr<Powerfield<double>>(read_tiff.readPowerfield(ss)); EXPECT_EQ(m_model_data.rank(), result->rank()); - for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) + for (size_t i = 0, size = m_model_data.allocatedSize(); i < size; ++i) EXPECT_EQ(m_model_data[i], (*result)[i]); } diff --git a/Tests/Unit/Device/IntensityDataFunctionsTest.cpp b/Tests/Unit/Device/IntensityDataFunctionsTest.cpp index 3af731a962d383e040ae7505f765429ab45cde9d..1e91224aa646e628e9365c0ae60a4a1c6d98a870 100644 --- a/Tests/Unit/Device/IntensityDataFunctionsTest.cpp +++ b/Tests/Unit/Device/IntensityDataFunctionsTest.cpp @@ -13,14 +13,14 @@ TEST_F(DataUtilsTest, ClipDataSetFixed) FixedBinAxis axis1("axis1", 3, 0.0, 3.0); data.addAxis(axis1); - for (size_t i = 0; i < data.getAllocatedSize(); ++i) + for (size_t i = 0; i < data.allocatedSize(); ++i) data[i] = static_cast<double>(i); auto clip = DataUtils::Data::createClippedDataSet(data, -5.0, 0.0, -1.5, 1.5); std::vector<double> vref = {0.0, 1.0, 3.0, 4.0, 6.0, 7.0, 9.0, 10.0}; - EXPECT_EQ(clip->getAllocatedSize(), size_t(8)); + EXPECT_EQ(clip->allocatedSize(), size_t(8)); size_t index(0); - for (size_t i = 0; i < clip->getAllocatedSize(); ++i) + for (size_t i = 0; i < clip->allocatedSize(); ++i) EXPECT_EQ(vref[index++], (*clip)[i]); } @@ -35,14 +35,14 @@ TEST_F(DataUtilsTest, ClipDataSetVariable) VariableBinAxis axis1("axis1", 4, values); data.addAxis(axis1); - for (size_t i = 0; i < data.getAllocatedSize(); ++i) + for (size_t i = 0; i < data.allocatedSize(); ++i) data[i] = static_cast<double>(i); auto clip = DataUtils::Data::createClippedDataSet(data, -0.5, 0.5, 0.99, 2.0); std::vector<double> vref = {6.0, 7.0, 10.0, 11.0}; - EXPECT_EQ(clip->getAllocatedSize(), size_t(4)); + EXPECT_EQ(clip->allocatedSize(), size_t(4)); size_t index(0); - for (size_t i = 0; i < clip->getAllocatedSize(); ++i) + for (size_t i = 0; i < clip->allocatedSize(); ++i) EXPECT_EQ(vref[index++], (*clip)[i]); } @@ -154,7 +154,7 @@ TEST_F(DataUtilsTest, create2DArrayfromPowerfieldTest) Powerfield<double> out_data; out_data.addAxis("axis0", 2, 1.0, 2.0); out_data.addAxis("axis1", 3, 3.0, 4.0); - EXPECT_EQ(6u, out_data.getAllocatedSize()); + EXPECT_EQ(6u, out_data.allocatedSize()); EXPECT_EQ(2u, out_data.axis(0).size()); // no. of rows EXPECT_EQ(3u, out_data.axis(1).size()); // no. of cols diff --git a/Tests/Unit/Device/PowerfieldTest.cpp b/Tests/Unit/Device/PowerfieldTest.cpp index 14f929eee55fa983f27bffe9af20da6578fef0f1..c1a4031eb74f17f003666934e21f9c14a5ebc0a4 100644 --- a/Tests/Unit/Device/PowerfieldTest.cpp +++ b/Tests/Unit/Device/PowerfieldTest.cpp @@ -32,7 +32,7 @@ PowerfieldTest::PowerfieldTest() TEST_F(PowerfieldTest, SizeAfterAddingAxes) { - EXPECT_EQ(2000u, db_data_3d.getAllocatedSize()); + EXPECT_EQ(2000u, db_data_3d.allocatedSize()); } TEST_F(PowerfieldTest, DataInitialization) diff --git a/Tests/Unit/Device/ReadSANSDRawTest.cpp b/Tests/Unit/Device/ReadSANSDRawTest.cpp index 53836bc36c747f6a7d0cd75e5bab23c78099ca67..edecb8ed7e2206e403860cd1d1294a8a075a283f 100644 --- a/Tests/Unit/Device/ReadSANSDRawTest.cpp +++ b/Tests/Unit/Device/ReadSANSDRawTest.cpp @@ -14,6 +14,6 @@ TEST_F(ReadSANSDRawTest, Read) if (!data) return; EXPECT_EQ(data->rank(), 2); - EXPECT_EQ(data->getAllocatedSize(), 16384); + EXPECT_EQ(data->allocatedSize(), 16384); EXPECT_EQ((*data)[128 * 70 + 62], 443); } diff --git a/Tests/Unit/Device/SphericalDetectorTest.cpp b/Tests/Unit/Device/SphericalDetectorTest.cpp index 8751329e76bb2466e6b3f55fec40ae2cb6dd16dc..f188c2970f527f9b258def02daefe08d4d2060bc 100644 --- a/Tests/Unit/Device/SphericalDetectorTest.cpp +++ b/Tests/Unit/Device/SphericalDetectorTest.cpp @@ -143,7 +143,7 @@ TEST_F(SphericalDetectorTest, MaskOfDetector) detector.addMask(polygon, true); const Powerfield<bool>* mask = detector.detectorMask()->getMaskData(); - for (size_t index = 0; index < mask->getAllocatedSize(); ++index) { + for (size_t index = 0; index < mask->allocatedSize(); ++index) { double x = mask->getAxisValue(index, 0); double y = mask->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) @@ -154,7 +154,7 @@ TEST_F(SphericalDetectorTest, MaskOfDetector) SphericalDetector detector2(detector); mask = detector2.detectorMask()->getMaskData(); - for (size_t index = 0; index < mask->getAllocatedSize(); ++index) { + for (size_t index = 0; index < mask->allocatedSize(); ++index) { double x = mask->getAxisValue(index, 0); double y = mask->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) @@ -164,7 +164,7 @@ TEST_F(SphericalDetectorTest, MaskOfDetector) } mask = detector.detectorMask()->getMaskData(); - for (size_t index = 0; index < mask->getAllocatedSize(); ++index) { + for (size_t index = 0; index < mask->allocatedSize(); ++index) { double x = mask->getAxisValue(index, 0); double y = mask->getAxisValue(index, 1); if (x >= -4.0 && x <= 4.0 && y >= -2.0 && y <= 2.0) diff --git a/Tests/Unit/Sim/CoordSystem1DTest.cpp b/Tests/Unit/Sim/CoordSystem1DTest.cpp index 0f3d782f864f7f426e9a48fe0d73f82d6164bd48..ffe0b6338bde42848312a4c23443845b9b89c5dc 100644 --- a/Tests/Unit/Sim/CoordSystem1DTest.cpp +++ b/Tests/Unit/Sim/CoordSystem1DTest.cpp @@ -97,7 +97,7 @@ void CoordSystem1DTest::checkConventionalConverter(const CoordSystem1D& test_obj // NBINS auto data_nbins = test_object.createConvertedData(fake_data, Axes::Coords::NBINS); EXPECT_EQ(data_nbins->axis(0), *axis_nbins); - EXPECT_EQ(data_nbins->getAllocatedSize(), axis_nbins->size()); + EXPECT_EQ(data_nbins->allocatedSize(), axis_nbins->size()); EXPECT_EQ(raw_fake, data_nbins->getRawDataVector()); // RQ4 @@ -165,7 +165,7 @@ void CoordSystem1DTest::checkQSpecConverter(const CoordSystem1D& test_object) // NBINS auto data_nbins = test_object.createConvertedData(fake_data, Axes::Coords::NBINS); EXPECT_EQ(data_nbins->axis(0), *axis_nbins); - EXPECT_EQ(data_nbins->getAllocatedSize(), axis_nbins->size()); + EXPECT_EQ(data_nbins->allocatedSize(), axis_nbins->size()); EXPECT_EQ(raw_fake, data_nbins->getRawDataVector()); // RQ4 diff --git a/Tests/Unit/Sim/DepthProbeSimulationTest.cpp b/Tests/Unit/Sim/DepthProbeSimulationTest.cpp index 4e78318ec63d733e34e7cb5c2bfdd4c37d4892bf..94a1c604e679adf30289ddf5ab02b4945d01e9a6 100644 --- a/Tests/Unit/Sim/DepthProbeSimulationTest.cpp +++ b/Tests/Unit/Sim/DepthProbeSimulationTest.cpp @@ -131,7 +131,7 @@ TEST_F(DepthProbeSimulationTest, ResultAquisition) EXPECT_FAILED_ASSERT(sim_result.data(Axes::Coords::MM)); const auto output = sim_result.data(); - EXPECT_EQ(depth_map->getTotalNumberOfBins(), output->getAllocatedSize()); + EXPECT_EQ(depth_map->getTotalNumberOfBins(), output->allocatedSize()); EXPECT_EQ(depth_map->rank(), output->rank()); EXPECT_EQ(depth_map->xAxis().lowerBound(), output->axis(0).lowerBound()); EXPECT_EQ(depth_map->xAxis().upperBound(), output->axis(0).upperBound()); diff --git a/Tests/Unit/Sim/SpecularSimulationTest.cpp b/Tests/Unit/Sim/SpecularSimulationTest.cpp index 951e900d6756e7cffde30c5089b565fc8e001375..d3da2a10f87d847ab985e5c95e341ca8a1274d41 100644 --- a/Tests/Unit/Sim/SpecularSimulationTest.cpp +++ b/Tests/Unit/Sim/SpecularSimulationTest.cpp @@ -169,7 +169,7 @@ TEST_F(SpecularSimulationTest, ConstructSimulation) const SimulationResult sim_result = sim->simulate(); auto data = sim_result.data(); - EXPECT_EQ(data->getAllocatedSize(), 10u); + EXPECT_EQ(data->allocatedSize(), 10u); EXPECT_EQ(data->rank(), 1u); EXPECT_NEAR(0.1 * Units::deg, sim_result.convertedBinCenters(Axes::Coords::RADIANS).front(),