From 7d68bcca13f475f410aea30ef70569db2e8e6fed Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Wed, 1 Jun 2022 21:20:00 +0200 Subject: [PATCH] split off files FramUtil --- Base/Axis/FrameUtil.cpp | 63 ++++ Base/Axis/FrameUtil.h | 37 +++ Device/Data/DataUtils.cpp | 45 --- Device/Data/DataUtils.h | 16 - GUI/Model/Device/MaskUnitsConverter.cpp | 1 + .../Device/IntensityDataFunctionsTest.cpp | 1 + auto/Wrap/doxygenBase.i | 30 +- auto/Wrap/doxygenDevice.i | 22 -- auto/Wrap/libBornAgainDevice.py | 40 --- auto/Wrap/libBornAgainDevice_wrap.cpp | 295 +++--------------- 10 files changed, 183 insertions(+), 367 deletions(-) create mode 100644 Base/Axis/FrameUtil.cpp create mode 100644 Base/Axis/FrameUtil.h diff --git a/Base/Axis/FrameUtil.cpp b/Base/Axis/FrameUtil.cpp new file mode 100644 index 00000000000..644719b64bf --- /dev/null +++ b/Base/Axis/FrameUtil.cpp @@ -0,0 +1,63 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Base/Axis/FrameUtil.cpp +//! @brief Implements namespace DataUtils. +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************************************ + +#include "Base/Axis/FrameUtil.h" +#include "Base/Axis/Bin.h" +#include "Base/Axis/Frame.h" +#include "Base/Axis/IAxis.h" + +// For axis FixedBinAxis("axis", 8, -5.0, 3.0) the coordinate x=-4.5 (center of bin #0) will +// be converted into 0.5 (which is a bin center expressed in bin fraction coordinates). +// The coordinate -5.0 (outside of axis definition) will be converted to -0.5 +// (center of non-existing bin #-1). +// Used for Mask conversion. + +double CoordUtils::coordinateToBinf(double coordinate, const IAxis& axis) +{ + size_t index = axis.findClosestIndex(coordinate); + Bin1D bin = axis.bin(index); + double f = (coordinate - bin.m_lower) / bin.binSize(); + return static_cast<double>(index) + f; +} + +double CoordUtils::coordinateFromBinf(double value, const IAxis& axis) +{ + int index = static_cast<int>(value); + + double result(0); + if (index < 0) { + Bin1D bin = axis.bin(0); + result = bin.m_lower + value * bin.binSize(); + } else if (index >= static_cast<int>(axis.size())) { + Bin1D bin = axis.bin(axis.size() - 1); + result = bin.m_upper + (value - axis.size()) * bin.binSize(); + } else { + Bin1D bin = axis.bin(static_cast<size_t>(index)); + result = bin.m_lower + (value - static_cast<double>(index)) * bin.binSize(); + } + + return result; +} + +void CoordUtils::coordinatesToBinf(double& x, double& y, const Frame& data) +{ + x = coordinateToBinf(x, data.xAxis()); + y = coordinateToBinf(y, data.yAxis()); +} + +void CoordUtils::coordinatesFromBinf(double& x, double& y, const Frame& data) +{ + x = coordinateFromBinf(x, data.xAxis()); + y = coordinateFromBinf(y, data.yAxis()); +} diff --git a/Base/Axis/FrameUtil.h b/Base/Axis/FrameUtil.h new file mode 100644 index 00000000000..fc8991452aa --- /dev/null +++ b/Base/Axis/FrameUtil.h @@ -0,0 +1,37 @@ +// ************************************************************************************************ +// +// BornAgain: simulate and fit reflection and scattering +// +//! @file Base/Axis/FrameUtil.h +//! @brief Defines namespace DataUtils. +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************************************ + +#ifndef BORNAGAIN_BASE_AXIS_FRAMEUTIL_H +#define BORNAGAIN_BASE_AXIS_FRAMEUTIL_H + +class Frame; +class IAxis; + +namespace CoordUtils { + +//! Transforms coordinate on axis into the bin-fraction-coordinate. +double coordinateToBinf(double coordinate, const IAxis& axis); + +//! Transforms bin-fraction-coordinate into axis coordinate. +double coordinateFromBinf(double value, const IAxis& axis); + +//! Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. +void coordinatesToBinf(double& x, double& y, const Frame& frame); + +//! Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. +void coordinatesFromBinf(double& x, double& y, const Frame& frame); + +} // namespace CoordUtils + +#endif // BORNAGAIN_BASE_AXIS_FRAMEUTIL_H diff --git a/Device/Data/DataUtils.cpp b/Device/Data/DataUtils.cpp index 056230a8f23..cd1655de920 100644 --- a/Device/Data/DataUtils.cpp +++ b/Device/Data/DataUtils.cpp @@ -36,51 +36,6 @@ std::vector<std::vector<double>> FT2DArray(const std::vector<std::vector<double> } // namespace -// For axis FixedBinAxis("axis", 8, -5.0, 3.0) the coordinate x=-4.5 (center of bin #0) will -// be converted into 0.5 (which is a bin center expressed in bin fraction coordinates). -// The coordinate -5.0 (outside of axis definition) will be converted to -0.5 -// (center of non-existing bin #-1). -// Used for Mask conversion. - -double CoordUtils::coordinateToBinf(double coordinate, const IAxis& axis) -{ - size_t index = axis.findClosestIndex(coordinate); - Bin1D bin = axis.bin(index); - double f = (coordinate - bin.m_lower) / bin.binSize(); - return static_cast<double>(index) + f; -} - -double CoordUtils::coordinateFromBinf(double value, const IAxis& axis) -{ - int index = static_cast<int>(value); - - double result(0); - if (index < 0) { - Bin1D bin = axis.bin(0); - result = bin.m_lower + value * bin.binSize(); - } else if (index >= static_cast<int>(axis.size())) { - Bin1D bin = axis.bin(axis.size() - 1); - result = bin.m_upper + (value - axis.size()) * bin.binSize(); - } else { - Bin1D bin = axis.bin(static_cast<size_t>(index)); - result = bin.m_lower + (value - static_cast<double>(index)) * bin.binSize(); - } - - return result; -} - -void CoordUtils::coordinatesToBinf(double& x, double& y, const Frame& data) -{ - x = coordinateToBinf(x, data.xAxis()); - y = coordinateToBinf(y, data.yAxis()); -} - -void CoordUtils::coordinatesFromBinf(double& x, double& y, const Frame& data) -{ - x = coordinateFromBinf(x, data.xAxis()); - y = coordinateFromBinf(y, data.yAxis()); -} - //! Returns relative difference between two data sets sum(dat[i] - ref[i])/ref[i]). double DataUtils::Data::relativeDataDifference(const std::vector<double>& dat, const std::vector<double>& ref) diff --git a/Device/Data/DataUtils.h b/Device/Data/DataUtils.h index d8fbb6c2f37..a253eb33299 100644 --- a/Device/Data/DataUtils.h +++ b/Device/Data/DataUtils.h @@ -18,22 +18,6 @@ #include "Device/Data/Powerfield.h" #include <memory> -namespace CoordUtils { - -//! Transforms coordinate on axis into the bin-fraction-coordinate. -double coordinateToBinf(double coordinate, const IAxis& axis); - -//! Transforms bin-fraction-coordinate into axis coordinate. -double coordinateFromBinf(double value, const IAxis& axis); - -//! Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. -void coordinatesToBinf(double& x, double& y, const Frame& frame); - -//! Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. -void coordinatesFromBinf(double& x, double& y, const Frame& frame); - -} // namespace CoordUtils - namespace DataUtils::Data { //! Returns relative difference between two data sets sum(dat[i] - ref[i])/ref[i]). diff --git a/GUI/Model/Device/MaskUnitsConverter.cpp b/GUI/Model/Device/MaskUnitsConverter.cpp index 527fc4ed4b5..599e66e266a 100644 --- a/GUI/Model/Device/MaskUnitsConverter.cpp +++ b/GUI/Model/Device/MaskUnitsConverter.cpp @@ -13,6 +13,7 @@ // ************************************************************************************************ #include "GUI/Model/Device/MaskUnitsConverter.h" +#include "Base/Axis/FrameUtil.h" #include "Device/Data/DataUtils.h" #include "GUI/Model/Data/IntensityDataItem.h" #include "GUI/Model/Data/ProjectionItems.h" diff --git a/Tests/Unit/Device/IntensityDataFunctionsTest.cpp b/Tests/Unit/Device/IntensityDataFunctionsTest.cpp index 8fdd7b252b5..5ca57552d6e 100644 --- a/Tests/Unit/Device/IntensityDataFunctionsTest.cpp +++ b/Tests/Unit/Device/IntensityDataFunctionsTest.cpp @@ -1,6 +1,7 @@ #include "Base/Axis/FixedBinAxis.h" #include "Base/Axis/VariableBinAxis.h" #include "Base/Axis/Frame.h" +#include "Base/Axis/FrameUtil.h" #include "Device/Data/DataUtils.h" #include "Tests/GTestWrapper/google_test.h" diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index 5f9cff9b6e9..cccb32a3f3d 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -1152,7 +1152,7 @@ C++ includes: WavevectorInfo.h // File: classFourierTransform_1_1Workspace.xml -// File: namespace_0d22.xml +// File: namespace_0d24.xml // File: namespaceBaseUtils.xml @@ -1354,6 +1354,28 @@ Returns environment variable. "; +// File: namespaceCoordUtils.xml +%feature("docstring") CoordUtils::coordinateToBinf "double CoordUtils::coordinateToBinf(double coordinate, const IAxis &axis) + +Transforms coordinate on axis into the bin-fraction-coordinate. +"; + +%feature("docstring") CoordUtils::coordinateFromBinf "double CoordUtils::coordinateFromBinf(double value, const IAxis &axis) + +Transforms bin-fraction-coordinate into axis coordinate. +"; + +%feature("docstring") CoordUtils::coordinatesToBinf "void CoordUtils::coordinatesToBinf(double &x, double &y, const Frame &frame) + +Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. +"; + +%feature("docstring") CoordUtils::coordinatesFromBinf "void CoordUtils::coordinatesFromBinf(double &x, double &y, const Frame &frame) + +Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. +"; + + // File: namespaceMath.xml %feature("docstring") Math::Bessel::StandardNormal "double Math::StandardNormal(double x) "; @@ -1572,6 +1594,12 @@ Returns a string of blanks with given width. By default the width equals standar // File: Frame_8h.xml +// File: FrameUtil_8cpp.xml + + +// File: FrameUtil_8h.xml + + // File: IAxis_8cpp.xml diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index e2a6d1b637f..739ae6e6176 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -2062,28 +2062,6 @@ Returns default units to convert to. // File: namespace_0d56.xml -// File: namespaceCoordUtils.xml -%feature("docstring") CoordUtils::coordinateToBinf "double CoordUtils::coordinateToBinf(double coordinate, const IAxis &axis) - -Transforms coordinate on axis into the bin-fraction-coordinate. -"; - -%feature("docstring") CoordUtils::coordinateFromBinf "double CoordUtils::coordinateFromBinf(double value, const IAxis &axis) - -Transforms bin-fraction-coordinate into axis coordinate. -"; - -%feature("docstring") CoordUtils::coordinatesToBinf "void CoordUtils::coordinatesToBinf(double &x, double &y, const Frame &frame) - -Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. -"; - -%feature("docstring") CoordUtils::coordinatesFromBinf "void CoordUtils::coordinatesFromBinf(double &x, double &y, const Frame &frame) - -Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. -"; - - // File: namespaceDataUtils.xml diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index d311c18466e..80bd048289c 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2286,46 +2286,6 @@ class Powerfield(object): _libBornAgainDevice.Powerfield_swigregister(Powerfield) -def coordinateToBinf(coordinate, axis): - r""" - coordinateToBinf(double coordinate, IAxis axis) -> double - double CoordUtils::coordinateToBinf(double coordinate, const IAxis &axis) - - Transforms coordinate on axis into the bin-fraction-coordinate. - - """ - return _libBornAgainDevice.coordinateToBinf(coordinate, axis) - -def coordinateFromBinf(value, axis): - r""" - coordinateFromBinf(double value, IAxis axis) -> double - double CoordUtils::coordinateFromBinf(double value, const IAxis &axis) - - Transforms bin-fraction-coordinate into axis coordinate. - - """ - return _libBornAgainDevice.coordinateFromBinf(value, axis) - -def coordinatesToBinf(x, y, frame): - r""" - coordinatesToBinf(double & x, double & y, Frame frame) - void CoordUtils::coordinatesToBinf(double &x, double &y, const Frame &frame) - - Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. - - """ - return _libBornAgainDevice.coordinatesToBinf(x, y, frame) - -def coordinatesFromBinf(x, y, frame): - r""" - coordinatesFromBinf(double & x, double & y, Frame frame) - void CoordUtils::coordinatesFromBinf(double &x, double &y, const Frame &frame) - - Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. - - """ - return _libBornAgainDevice.coordinatesFromBinf(x, y, frame) - def relativeDataDifference(dat, ref): r""" relativeDataDifference(vdouble1d_t dat, vdouble1d_t ref) -> double diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index e8c5022a156..5ccbf3e3be5 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -3144,59 +3144,58 @@ namespace Swig { #define SWIGTYPE_p_const_iterator swig_types[44] #define SWIGTYPE_p_corr_matrix_t swig_types[45] #define SWIGTYPE_p_difference_type swig_types[46] -#define SWIGTYPE_p_double swig_types[47] -#define SWIGTYPE_p_first_type swig_types[48] -#define SWIGTYPE_p_int swig_types[49] -#define SWIGTYPE_p_iterator swig_types[50] -#define SWIGTYPE_p_key_type swig_types[51] -#define SWIGTYPE_p_long_long swig_types[52] -#define SWIGTYPE_p_mapped_type swig_types[53] -#define SWIGTYPE_p_p_ICoordSystem swig_types[54] -#define SWIGTYPE_p_p_PyObject swig_types[55] -#define SWIGTYPE_p_parameters_t swig_types[56] -#define SWIGTYPE_p_second_type swig_types[57] -#define SWIGTYPE_p_short swig_types[58] -#define SWIGTYPE_p_signed_char swig_types[59] -#define SWIGTYPE_p_size_type swig_types[60] -#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[61] -#define SWIGTYPE_p_std__allocatorT_double_t swig_types[62] -#define SWIGTYPE_p_std__allocatorT_int_t swig_types[63] -#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[64] -#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[65] -#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[66] -#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[67] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[68] -#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[69] -#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[70] -#define SWIGTYPE_p_std__complexT_double_t swig_types[71] -#define SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t swig_types[72] -#define SWIGTYPE_p_std__invalid_argument swig_types[73] -#define SWIGTYPE_p_std__lessT_std__string_t swig_types[74] -#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[75] -#define SWIGTYPE_p_std__pairT_double_double_t swig_types[76] -#define SWIGTYPE_p_std__vectorT_CumulativeValue_std__allocatorT_CumulativeValue_t_t swig_types[77] -#define SWIGTYPE_p_std__vectorT_IAxis_p_std__allocatorT_IAxis_p_t_t swig_types[78] -#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[79] -#define SWIGTYPE_p_std__vectorT_ParaMeta_std__allocatorT_ParaMeta_t_t swig_types[80] -#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[81] -#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[82] -#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[83] -#define SWIGTYPE_p_std__vectorT_size_t_std__allocatorT_size_t_t_t swig_types[84] -#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[85] -#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[86] -#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[87] -#define SWIGTYPE_p_std__vectorT_std__unique_ptrT_DiffuseElement_t_std__allocatorT_std__unique_ptrT_DiffuseElement_t_t_t swig_types[88] -#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[89] -#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[90] -#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[91] -#define SWIGTYPE_p_swig__SwigPyIterator swig_types[92] -#define SWIGTYPE_p_unsigned_char swig_types[93] -#define SWIGTYPE_p_unsigned_int swig_types[94] -#define SWIGTYPE_p_unsigned_long_long swig_types[95] -#define SWIGTYPE_p_unsigned_short swig_types[96] -#define SWIGTYPE_p_value_type swig_types[97] -static swig_type_info *swig_types[99]; -static swig_module_info swig_module = {swig_types, 98, 0, 0, 0, 0}; +#define SWIGTYPE_p_first_type swig_types[47] +#define SWIGTYPE_p_int swig_types[48] +#define SWIGTYPE_p_iterator swig_types[49] +#define SWIGTYPE_p_key_type swig_types[50] +#define SWIGTYPE_p_long_long swig_types[51] +#define SWIGTYPE_p_mapped_type swig_types[52] +#define SWIGTYPE_p_p_ICoordSystem swig_types[53] +#define SWIGTYPE_p_p_PyObject swig_types[54] +#define SWIGTYPE_p_parameters_t swig_types[55] +#define SWIGTYPE_p_second_type swig_types[56] +#define SWIGTYPE_p_short swig_types[57] +#define SWIGTYPE_p_signed_char swig_types[58] +#define SWIGTYPE_p_size_type swig_types[59] +#define SWIGTYPE_p_std__allocatorT_Vec3T_double_t_t swig_types[60] +#define SWIGTYPE_p_std__allocatorT_double_t swig_types[61] +#define SWIGTYPE_p_std__allocatorT_int_t swig_types[62] +#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[63] +#define SWIGTYPE_p_std__allocatorT_std__pairT_double_double_t_t swig_types[64] +#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_double_t_t swig_types[65] +#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[66] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[67] +#define SWIGTYPE_p_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t swig_types[68] +#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[69] +#define SWIGTYPE_p_std__complexT_double_t swig_types[70] +#define SWIGTYPE_p_std__functionT_void_fSimulationAreaIterator_const_RF_t swig_types[71] +#define SWIGTYPE_p_std__invalid_argument swig_types[72] +#define SWIGTYPE_p_std__lessT_std__string_t swig_types[73] +#define SWIGTYPE_p_std__mapT_std__string_double_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_double_t_t_t swig_types[74] +#define SWIGTYPE_p_std__pairT_double_double_t swig_types[75] +#define SWIGTYPE_p_std__vectorT_CumulativeValue_std__allocatorT_CumulativeValue_t_t swig_types[76] +#define SWIGTYPE_p_std__vectorT_IAxis_p_std__allocatorT_IAxis_p_t_t swig_types[77] +#define SWIGTYPE_p_std__vectorT_INode_const_p_std__allocatorT_INode_const_p_t_t swig_types[78] +#define SWIGTYPE_p_std__vectorT_ParaMeta_std__allocatorT_ParaMeta_t_t swig_types[79] +#define SWIGTYPE_p_std__vectorT_Vec3T_double_t_std__allocatorT_Vec3T_double_t_t_t swig_types[80] +#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[81] +#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[82] +#define SWIGTYPE_p_std__vectorT_size_t_std__allocatorT_size_t_t_t swig_types[83] +#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[84] +#define SWIGTYPE_p_std__vectorT_std__pairT_double_double_t_std__allocatorT_std__pairT_double_double_t_t_t swig_types[85] +#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[86] +#define SWIGTYPE_p_std__vectorT_std__unique_ptrT_DiffuseElement_t_std__allocatorT_std__unique_ptrT_DiffuseElement_t_t_t swig_types[87] +#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[88] +#define SWIGTYPE_p_std__vectorT_std__vectorT_int_std__allocatorT_int_t_t_std__allocatorT_std__vectorT_int_std__allocatorT_int_t_t_t_t swig_types[89] +#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[90] +#define SWIGTYPE_p_swig__SwigPyIterator swig_types[91] +#define SWIGTYPE_p_unsigned_char swig_types[92] +#define SWIGTYPE_p_unsigned_int swig_types[93] +#define SWIGTYPE_p_unsigned_long_long swig_types[94] +#define SWIGTYPE_p_unsigned_short swig_types[95] +#define SWIGTYPE_p_value_type swig_types[96] +static swig_type_info *swig_types[98]; +static swig_module_info swig_module = {swig_types, 97, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -28230,164 +28229,6 @@ SWIGINTERN PyObject *Powerfield_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObjec return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_coordinateToBinf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double arg1 ; - IAxis *arg2 = 0 ; - double val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - double result; - - if (!SWIG_Python_UnpackTuple(args, "coordinateToBinf", 2, 2, swig_obj)) SWIG_fail; - ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "coordinateToBinf" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "coordinateToBinf" "', argument " "2"" of type '" "IAxis const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinateToBinf" "', argument " "2"" of type '" "IAxis const &""'"); - } - arg2 = reinterpret_cast< IAxis * >(argp2); - result = (double)CoordUtils::coordinateToBinf(arg1,(IAxis const &)*arg2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_coordinateFromBinf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double arg1 ; - IAxis *arg2 = 0 ; - double val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - double result; - - if (!SWIG_Python_UnpackTuple(args, "coordinateFromBinf", 2, 2, swig_obj)) SWIG_fail; - ecode1 = SWIG_AsVal_double(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "coordinateFromBinf" "', argument " "1"" of type '" "double""'"); - } - arg1 = static_cast< double >(val1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "coordinateFromBinf" "', argument " "2"" of type '" "IAxis const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinateFromBinf" "', argument " "2"" of type '" "IAxis const &""'"); - } - arg2 = reinterpret_cast< IAxis * >(argp2); - result = (double)CoordUtils::coordinateFromBinf(arg1,(IAxis const &)*arg2); - resultobj = SWIG_From_double(static_cast< double >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_coordinatesToBinf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double *arg1 = 0 ; - double *arg2 = 0 ; - Frame *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - - if (!SWIG_Python_UnpackTuple(args, "coordinatesToBinf", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_double, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "coordinatesToBinf" "', argument " "1"" of type '" "double &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesToBinf" "', argument " "1"" of type '" "double &""'"); - } - arg1 = reinterpret_cast< double * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_double, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "coordinatesToBinf" "', argument " "2"" of type '" "double &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesToBinf" "', argument " "2"" of type '" "double &""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Frame, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "coordinatesToBinf" "', argument " "3"" of type '" "Frame const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesToBinf" "', argument " "3"" of type '" "Frame const &""'"); - } - arg3 = reinterpret_cast< Frame * >(argp3); - CoordUtils::coordinatesToBinf(*arg1,*arg2,(Frame const &)*arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_coordinatesFromBinf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - double *arg1 = 0 ; - double *arg2 = 0 ; - Frame *arg3 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject *swig_obj[3] ; - - if (!SWIG_Python_UnpackTuple(args, "coordinatesFromBinf", 3, 3, swig_obj)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_double, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "coordinatesFromBinf" "', argument " "1"" of type '" "double &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesFromBinf" "', argument " "1"" of type '" "double &""'"); - } - arg1 = reinterpret_cast< double * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_double, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "coordinatesFromBinf" "', argument " "2"" of type '" "double &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesFromBinf" "', argument " "2"" of type '" "double &""'"); - } - arg2 = reinterpret_cast< double * >(argp2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Frame, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "coordinatesFromBinf" "', argument " "3"" of type '" "Frame const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "coordinatesFromBinf" "', argument " "3"" of type '" "Frame const &""'"); - } - arg3 = reinterpret_cast< Frame * >(argp3); - CoordUtils::coordinatesFromBinf(*arg1,*arg2,(Frame const &)*arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_relativeDataDifference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; std::vector< double,std::allocator< double > > *arg1 = 0 ; @@ -39235,34 +39076,6 @@ static PyMethodDef SwigMethods[] = { ""}, { "Powerfield_swigregister", Powerfield_swigregister, METH_O, NULL}, { "Powerfield_swiginit", Powerfield_swiginit, METH_VARARGS, NULL}, - { "coordinateToBinf", _wrap_coordinateToBinf, METH_VARARGS, "\n" - "coordinateToBinf(double coordinate, IAxis axis) -> double\n" - "double CoordUtils::coordinateToBinf(double coordinate, const IAxis &axis)\n" - "\n" - "Transforms coordinate on axis into the bin-fraction-coordinate. \n" - "\n" - ""}, - { "coordinateFromBinf", _wrap_coordinateFromBinf, METH_VARARGS, "\n" - "coordinateFromBinf(double value, IAxis axis) -> double\n" - "double CoordUtils::coordinateFromBinf(double value, const IAxis &axis)\n" - "\n" - "Transforms bin-fraction-coordinate into axis coordinate. \n" - "\n" - ""}, - { "coordinatesToBinf", _wrap_coordinatesToBinf, METH_VARARGS, "\n" - "coordinatesToBinf(double & x, double & y, Frame frame)\n" - "void CoordUtils::coordinatesToBinf(double &x, double &y, const Frame &frame)\n" - "\n" - "Transforms x,y coordinate from Powerfield axes coordinates to bin-fraction-coordinates. \n" - "\n" - ""}, - { "coordinatesFromBinf", _wrap_coordinatesFromBinf, METH_VARARGS, "\n" - "coordinatesFromBinf(double & x, double & y, Frame frame)\n" - "void CoordUtils::coordinatesFromBinf(double &x, double &y, const Frame &frame)\n" - "\n" - "Transforms x,y coordinate from bin-fraction-coordinates to Powerfield's axes coordinates. \n" - "\n" - ""}, { "relativeDataDifference", _wrap_relativeDataDifference, METH_VARARGS, "\n" "relativeDataDifference(vdouble1d_t dat, vdouble1d_t ref) -> double\n" "double DataUtils::Data::relativeDataDifference(const std::vector< double > &dat, const std::vector< double > &ref)\n" @@ -40830,7 +40643,6 @@ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_const_iterator = {"_p_const_iterator", "const_iterator *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_corr_matrix_t = {"_p_corr_matrix_t", "corr_matrix_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_first_type = {"_p_first_type", "first_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_iterator = {"_p_iterator", "iterator *", 0, 0, (void*)0, 0}; @@ -40930,7 +40742,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_const_iterator, &_swigt__p_corr_matrix_t, &_swigt__p_difference_type, - &_swigt__p_double, &_swigt__p_first_type, &_swigt__p_int, &_swigt__p_iterator, @@ -41030,7 +40841,6 @@ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, static swig_cast_info _swigc__p_const_iterator[] = { {&_swigt__p_const_iterator, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_corr_matrix_t[] = { {&_swigt__p_corr_matrix_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_first_type[] = { {&_swigt__p_first_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_iterator[] = { {&_swigt__p_iterator, 0, 0, 0},{0, 0, 0, 0}}; @@ -41130,7 +40940,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_const_iterator, _swigc__p_corr_matrix_t, _swigc__p_difference_type, - _swigc__p_double, _swigc__p_first_type, _swigc__p_int, _swigc__p_iterator, -- GitLab