From 2c74cd31d256a243aa21bed7643617b04e26e383 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sun, 22 Jan 2023 13:48:08 +0100 Subject: [PATCH] rm limits from RangedDistribution* c'tors --- GUI/Model/Descriptor/DistributionItems.cpp | 9 +- Param/Distrib/RangedDistributions.cpp | 33 +- Param/Distrib/RangedDistributions.h | 20 +- auto/Wrap/libBornAgainParam.py | 30 +- auto/Wrap/libBornAgainParam_wrap.cpp | 505 +-------------------- 5 files changed, 54 insertions(+), 543 deletions(-) diff --git a/GUI/Model/Descriptor/DistributionItems.cpp b/GUI/Model/Descriptor/DistributionItems.cpp index d2e3a572bf0..8e8e2535dc4 100644 --- a/GUI/Model/Descriptor/DistributionItems.cpp +++ b/GUI/Model/Descriptor/DistributionItems.cpp @@ -309,8 +309,7 @@ std::unique_ptr<IDistribution1D> DistributionLorentzItem::createDistribution(dou std::unique_ptr<IRangedDistribution> DistributionLorentzItem::createIRangedDistribution(double scale) const { - return std::make_unique<RangedDistributionLorentz>(numberOfSamples(), m_sigmaFactor.value(), - m_limits.scaledLimits(scale)); + return std::make_unique<RangedDistributionLorentz>(numberOfSamples(), m_sigmaFactor.value()); } double DistributionLorentzItem::deviation(double scale) const @@ -399,8 +398,7 @@ std::unique_ptr<IDistribution1D> DistributionGaussianItem::createDistribution(do std::unique_ptr<IRangedDistribution> DistributionGaussianItem::createIRangedDistribution(double scale) const { - return std::make_unique<RangedDistributionGaussian>(m_numberOfSamples, m_sigmaFactor.value(), - m_limits.scaledLimits(scale)); + return std::make_unique<RangedDistributionGaussian>(m_numberOfSamples, m_sigmaFactor.value()); } double DistributionGaussianItem::deviation(double scale) const @@ -571,8 +569,7 @@ std::unique_ptr<IDistribution1D> DistributionCosineItem::createDistribution(doub std::unique_ptr<IRangedDistribution> DistributionCosineItem::createIRangedDistribution(double scale) const { - return std::make_unique<RangedDistributionCosine>(m_numberOfSamples, m_sigmaFactor.value(), - m_limits.scaledLimits(scale)); + return std::make_unique<RangedDistributionCosine>(m_numberOfSamples, m_sigmaFactor.value()); } double DistributionCosineItem::deviation(double scale) const diff --git a/Param/Distrib/RangedDistributions.cpp b/Param/Distrib/RangedDistributions.cpp index fb9bcbbe74d..06d48def61a 100644 --- a/Param/Distrib/RangedDistributions.cpp +++ b/Param/Distrib/RangedDistributions.cpp @@ -24,7 +24,7 @@ namespace { template <class T> std::unique_ptr<T> makeCopy(const T& item) { - return std::make_unique<T>(item.nSamples(), item.sigmaFactor(), item.limits()); + return std::make_unique<T>(item.nSamples(), item.sigmaFactor()); } const double gate_stddev_factor = 2.0 * std::sqrt(3.0); @@ -44,12 +44,6 @@ IRangedDistribution::IRangedDistribution(size_t n_samples, double sigma_factor, checkInitialization(); } -IRangedDistribution::IRangedDistribution(size_t n_samples, double sigma_factor, double min, - double max) - : IRangedDistribution(n_samples, sigma_factor, RealLimits::limited(min, max)) -{ -} - IRangedDistribution::IRangedDistribution(size_t n_samples, double sigma_factor) : IRangedDistribution(n_samples, sigma_factor, RealLimits::limitless()) { @@ -95,9 +89,8 @@ void IRangedDistribution::checkInitialization() // class RangedDistributionGate // ************************************************************************************************ -RangedDistributionGate::RangedDistributionGate(size_t n_samples, double sigma_factor, - const RealLimits& limits) - : IRangedDistribution(n_samples, sigma_factor, limits) +RangedDistributionGate::RangedDistributionGate(size_t n_samples, double sigma_factor) + : IRangedDistribution(n_samples, sigma_factor) { } @@ -122,9 +115,8 @@ IDistribution1D* RangedDistributionGate::distribution_impl(double mean, double s // class RangedDistributionLorentz // ************************************************************************************************ -RangedDistributionLorentz::RangedDistributionLorentz(size_t n_samples, double hwhm_factor, - const RealLimits& limits) - : IRangedDistribution(n_samples, hwhm_factor, limits) +RangedDistributionLorentz::RangedDistributionLorentz(size_t n_samples, double hwhm_factor) + : IRangedDistribution(n_samples, hwhm_factor) { } @@ -147,9 +139,8 @@ IDistribution1D* RangedDistributionLorentz::distribution_impl(double median, dou // class RangedDistributionGaussian // ************************************************************************************************ -RangedDistributionGaussian::RangedDistributionGaussian(size_t n_samples, double sigma_factor, - const RealLimits& limits) - : IRangedDistribution(n_samples, sigma_factor, limits) +RangedDistributionGaussian::RangedDistributionGaussian(size_t n_samples, double sigma_factor) + : IRangedDistribution(n_samples, sigma_factor) { } @@ -172,9 +163,8 @@ IDistribution1D* RangedDistributionGaussian::distribution_impl(double mean, doub // class RangedDistributionLogNormal // ************************************************************************************************ -RangedDistributionLogNormal::RangedDistributionLogNormal(size_t n_samples, double sigma_factor, - const RealLimits& limits) - : IRangedDistribution(n_samples, sigma_factor, limits) +RangedDistributionLogNormal::RangedDistributionLogNormal(size_t n_samples, double sigma_factor) + : IRangedDistribution(n_samples, sigma_factor) { } @@ -204,9 +194,8 @@ IDistribution1D* RangedDistributionLogNormal::distribution_impl(double mean, dou // class RangedDistributionCosine // ************************************************************************************************ -RangedDistributionCosine::RangedDistributionCosine(size_t n_samples, double sigma_factor, - const RealLimits& limits) - : IRangedDistribution(n_samples, sigma_factor, limits) +RangedDistributionCosine::RangedDistributionCosine(size_t n_samples, double sigma_factor) + : IRangedDistribution(n_samples, sigma_factor) { } diff --git a/Param/Distrib/RangedDistributions.h b/Param/Distrib/RangedDistributions.h index afeb0062b76..a9245ac64d9 100644 --- a/Param/Distrib/RangedDistributions.h +++ b/Param/Distrib/RangedDistributions.h @@ -35,11 +35,6 @@ class ParameterSample; class IRangedDistribution : public ICloneable { public: IRangedDistribution() = delete; - //! Initializes Ranged distribution with given number of samples, sigma factor - //! (range in standard deviations to take into account during sample generation) - //! and limits (either RealLimits object or just min and max limits). - //! By default _n_samples_ = 5, _sigma_factor_ = 2.0, while the limits are (-inf, +inf). - IRangedDistribution(size_t n_samples, double sigma_factor, double min, double max); IRangedDistribution(size_t n_samples, double sigma_factor); ~IRangedDistribution() override; @@ -103,8 +98,7 @@ private: class RangedDistributionGate : public IRangedDistribution { public: - RangedDistributionGate(size_t n_samples, double sigma_factor, - const RealLimits& limits = RealLimits::limitless()); + RangedDistributionGate(size_t n_samples, double sigma_factor); ~RangedDistributionGate() override = default; @@ -125,8 +119,7 @@ protected: class RangedDistributionLorentz : public IRangedDistribution { public: - RangedDistributionLorentz(size_t n_samples, double hwhm_factor, - const RealLimits& limits = RealLimits::limitless()); + RangedDistributionLorentz(size_t n_samples, double hwhm_factor); ~RangedDistributionLorentz() override = default; @@ -147,8 +140,7 @@ protected: class RangedDistributionGaussian : public IRangedDistribution { public: - RangedDistributionGaussian(size_t n_samples, double sigma_factor, - const RealLimits& limits = RealLimits::limitless()); + RangedDistributionGaussian(size_t n_samples, double sigma_factor); ~RangedDistributionGaussian() override = default; @@ -169,8 +161,7 @@ protected: class RangedDistributionLogNormal : public IRangedDistribution { public: - RangedDistributionLogNormal(size_t n_samples, double sigma_factor, - const RealLimits& limits = RealLimits::limitless()); + RangedDistributionLogNormal(size_t n_samples, double sigma_factor); ~RangedDistributionLogNormal() override = default; @@ -191,8 +182,7 @@ protected: class RangedDistributionCosine : public IRangedDistribution { public: - RangedDistributionCosine(size_t n_samples, double sigma_factor, - const RealLimits& limits = RealLimits::limitless()); + RangedDistributionCosine(size_t n_samples, double sigma_factor); ~RangedDistributionCosine() override = default; diff --git a/auto/Wrap/libBornAgainParam.py b/auto/Wrap/libBornAgainParam.py index 63f796ac53d..d4eb68d0279 100644 --- a/auto/Wrap/libBornAgainParam.py +++ b/auto/Wrap/libBornAgainParam.py @@ -2072,9 +2072,9 @@ class RangedDistributionGate(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r"""__init__(RangedDistributionGate self, size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless()) -> RangedDistributionGate""" - _libBornAgainParam.RangedDistributionGate_swiginit(self, _libBornAgainParam.new_RangedDistributionGate(*args)) + def __init__(self, n_samples, sigma_factor): + r"""__init__(RangedDistributionGate self, size_t n_samples, double sigma_factor) -> RangedDistributionGate""" + _libBornAgainParam.RangedDistributionGate_swiginit(self, _libBornAgainParam.new_RangedDistributionGate(n_samples, sigma_factor)) __swig_destroy__ = _libBornAgainParam.delete_RangedDistributionGate def clone(self): @@ -2089,9 +2089,9 @@ class RangedDistributionLorentz(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r"""__init__(RangedDistributionLorentz self, size_t n_samples, double hwhm_factor, RealLimits const & limits=RealLimits::limitless()) -> RangedDistributionLorentz""" - _libBornAgainParam.RangedDistributionLorentz_swiginit(self, _libBornAgainParam.new_RangedDistributionLorentz(*args)) + def __init__(self, n_samples, hwhm_factor): + r"""__init__(RangedDistributionLorentz self, size_t n_samples, double hwhm_factor) -> RangedDistributionLorentz""" + _libBornAgainParam.RangedDistributionLorentz_swiginit(self, _libBornAgainParam.new_RangedDistributionLorentz(n_samples, hwhm_factor)) __swig_destroy__ = _libBornAgainParam.delete_RangedDistributionLorentz def clone(self): @@ -2106,9 +2106,9 @@ class RangedDistributionGaussian(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r"""__init__(RangedDistributionGaussian self, size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless()) -> RangedDistributionGaussian""" - _libBornAgainParam.RangedDistributionGaussian_swiginit(self, _libBornAgainParam.new_RangedDistributionGaussian(*args)) + def __init__(self, n_samples, sigma_factor): + r"""__init__(RangedDistributionGaussian self, size_t n_samples, double sigma_factor) -> RangedDistributionGaussian""" + _libBornAgainParam.RangedDistributionGaussian_swiginit(self, _libBornAgainParam.new_RangedDistributionGaussian(n_samples, sigma_factor)) __swig_destroy__ = _libBornAgainParam.delete_RangedDistributionGaussian def clone(self): @@ -2123,9 +2123,9 @@ class RangedDistributionLogNormal(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r"""__init__(RangedDistributionLogNormal self, size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless()) -> RangedDistributionLogNormal""" - _libBornAgainParam.RangedDistributionLogNormal_swiginit(self, _libBornAgainParam.new_RangedDistributionLogNormal(*args)) + def __init__(self, n_samples, sigma_factor): + r"""__init__(RangedDistributionLogNormal self, size_t n_samples, double sigma_factor) -> RangedDistributionLogNormal""" + _libBornAgainParam.RangedDistributionLogNormal_swiginit(self, _libBornAgainParam.new_RangedDistributionLogNormal(n_samples, sigma_factor)) __swig_destroy__ = _libBornAgainParam.delete_RangedDistributionLogNormal def clone(self): @@ -2140,9 +2140,9 @@ class RangedDistributionCosine(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr - def __init__(self, *args): - r"""__init__(RangedDistributionCosine self, size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless()) -> RangedDistributionCosine""" - _libBornAgainParam.RangedDistributionCosine_swiginit(self, _libBornAgainParam.new_RangedDistributionCosine(*args)) + def __init__(self, n_samples, sigma_factor): + r"""__init__(RangedDistributionCosine self, size_t n_samples, double sigma_factor) -> RangedDistributionCosine""" + _libBornAgainParam.RangedDistributionCosine_swiginit(self, _libBornAgainParam.new_RangedDistributionCosine(n_samples, sigma_factor)) __swig_destroy__ = _libBornAgainParam.delete_RangedDistributionCosine def clone(self): diff --git a/auto/Wrap/libBornAgainParam_wrap.cpp b/auto/Wrap/libBornAgainParam_wrap.cpp index ee8ebc1bd4e..f7c8e500cf7 100644 --- a/auto/Wrap/libBornAgainParam_wrap.cpp +++ b/auto/Wrap/libBornAgainParam_wrap.cpp @@ -28012,47 +28012,7 @@ SWIGINTERN PyObject *ParameterDistribution_swiginit(PyObject *SWIGUNUSEDPARM(sel return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_RangedDistributionGate__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - size_t arg1 ; - double arg2 ; - RealLimits *arg3 = 0 ; - size_t val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - RangedDistributionGate *result = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionGate" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangedDistributionGate" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_RealLimits, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RangedDistributionGate" "', argument " "3"" of type '" "RealLimits const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RangedDistributionGate" "', argument " "3"" of type '" "RealLimits const &""'"); - } - arg3 = reinterpret_cast< RealLimits * >(argp3); - result = (RangedDistributionGate *)new RangedDistributionGate(arg1,arg2,(RealLimits const &)*arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RangedDistributionGate, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangedDistributionGate__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_RangedDistributionGate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -28060,9 +28020,10 @@ SWIGINTERN PyObject *_wrap_new_RangedDistributionGate__SWIG_1(PyObject *self, Py int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; + PyObject *swig_obj[2] ; RangedDistributionGate *result = 0 ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_RangedDistributionGate", 2, 2, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionGate" "', argument " "1"" of type '" "size_t""'"); @@ -28081,60 +28042,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_RangedDistributionGate(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_RangedDistributionGate", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangedDistributionGate__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_RealLimits, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RangedDistributionGate__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RangedDistributionGate'.\n" - " Possible C/C++ prototypes are:\n" - " RangedDistributionGate::RangedDistributionGate(size_t,double,RealLimits const &)\n" - " RangedDistributionGate::RangedDistributionGate(size_t,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_RangedDistributionGate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RangedDistributionGate *arg1 = (RangedDistributionGate *) 0 ; @@ -28191,47 +28098,7 @@ SWIGINTERN PyObject *RangedDistributionGate_swiginit(PyObject *SWIGUNUSEDPARM(se return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_RangedDistributionLorentz__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - size_t arg1 ; - double arg2 ; - RealLimits *arg3 = 0 ; - size_t val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - RangedDistributionLorentz *result = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionLorentz" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangedDistributionLorentz" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_RealLimits, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RangedDistributionLorentz" "', argument " "3"" of type '" "RealLimits const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RangedDistributionLorentz" "', argument " "3"" of type '" "RealLimits const &""'"); - } - arg3 = reinterpret_cast< RealLimits * >(argp3); - result = (RangedDistributionLorentz *)new RangedDistributionLorentz(arg1,arg2,(RealLimits const &)*arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RangedDistributionLorentz, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangedDistributionLorentz__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_RangedDistributionLorentz(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -28239,9 +28106,10 @@ SWIGINTERN PyObject *_wrap_new_RangedDistributionLorentz__SWIG_1(PyObject *self, int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; + PyObject *swig_obj[2] ; RangedDistributionLorentz *result = 0 ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_RangedDistributionLorentz", 2, 2, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionLorentz" "', argument " "1"" of type '" "size_t""'"); @@ -28260,60 +28128,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_RangedDistributionLorentz(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_RangedDistributionLorentz", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangedDistributionLorentz__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_RealLimits, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RangedDistributionLorentz__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RangedDistributionLorentz'.\n" - " Possible C/C++ prototypes are:\n" - " RangedDistributionLorentz::RangedDistributionLorentz(size_t,double,RealLimits const &)\n" - " RangedDistributionLorentz::RangedDistributionLorentz(size_t,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_RangedDistributionLorentz(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RangedDistributionLorentz *arg1 = (RangedDistributionLorentz *) 0 ; @@ -28370,47 +28184,7 @@ SWIGINTERN PyObject *RangedDistributionLorentz_swiginit(PyObject *SWIGUNUSEDPARM return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_RangedDistributionGaussian__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - size_t arg1 ; - double arg2 ; - RealLimits *arg3 = 0 ; - size_t val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - RangedDistributionGaussian *result = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionGaussian" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangedDistributionGaussian" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_RealLimits, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RangedDistributionGaussian" "', argument " "3"" of type '" "RealLimits const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RangedDistributionGaussian" "', argument " "3"" of type '" "RealLimits const &""'"); - } - arg3 = reinterpret_cast< RealLimits * >(argp3); - result = (RangedDistributionGaussian *)new RangedDistributionGaussian(arg1,arg2,(RealLimits const &)*arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RangedDistributionGaussian, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangedDistributionGaussian__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_RangedDistributionGaussian(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -28418,9 +28192,10 @@ SWIGINTERN PyObject *_wrap_new_RangedDistributionGaussian__SWIG_1(PyObject *self int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; + PyObject *swig_obj[2] ; RangedDistributionGaussian *result = 0 ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_RangedDistributionGaussian", 2, 2, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionGaussian" "', argument " "1"" of type '" "size_t""'"); @@ -28439,60 +28214,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_RangedDistributionGaussian(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_RangedDistributionGaussian", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangedDistributionGaussian__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_RealLimits, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RangedDistributionGaussian__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RangedDistributionGaussian'.\n" - " Possible C/C++ prototypes are:\n" - " RangedDistributionGaussian::RangedDistributionGaussian(size_t,double,RealLimits const &)\n" - " RangedDistributionGaussian::RangedDistributionGaussian(size_t,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_RangedDistributionGaussian(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RangedDistributionGaussian *arg1 = (RangedDistributionGaussian *) 0 ; @@ -28549,47 +28270,7 @@ SWIGINTERN PyObject *RangedDistributionGaussian_swiginit(PyObject *SWIGUNUSEDPAR return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_RangedDistributionLogNormal__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - size_t arg1 ; - double arg2 ; - RealLimits *arg3 = 0 ; - size_t val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - RangedDistributionLogNormal *result = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionLogNormal" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangedDistributionLogNormal" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_RealLimits, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RangedDistributionLogNormal" "', argument " "3"" of type '" "RealLimits const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RangedDistributionLogNormal" "', argument " "3"" of type '" "RealLimits const &""'"); - } - arg3 = reinterpret_cast< RealLimits * >(argp3); - result = (RangedDistributionLogNormal *)new RangedDistributionLogNormal(arg1,arg2,(RealLimits const &)*arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RangedDistributionLogNormal, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangedDistributionLogNormal__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_RangedDistributionLogNormal(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -28597,9 +28278,10 @@ SWIGINTERN PyObject *_wrap_new_RangedDistributionLogNormal__SWIG_1(PyObject *sel int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; + PyObject *swig_obj[2] ; RangedDistributionLogNormal *result = 0 ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_RangedDistributionLogNormal", 2, 2, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionLogNormal" "', argument " "1"" of type '" "size_t""'"); @@ -28618,60 +28300,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_RangedDistributionLogNormal(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_RangedDistributionLogNormal", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangedDistributionLogNormal__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_RealLimits, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RangedDistributionLogNormal__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RangedDistributionLogNormal'.\n" - " Possible C/C++ prototypes are:\n" - " RangedDistributionLogNormal::RangedDistributionLogNormal(size_t,double,RealLimits const &)\n" - " RangedDistributionLogNormal::RangedDistributionLogNormal(size_t,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_RangedDistributionLogNormal(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RangedDistributionLogNormal *arg1 = (RangedDistributionLogNormal *) 0 ; @@ -28728,47 +28356,7 @@ SWIGINTERN PyObject *RangedDistributionLogNormal_swiginit(PyObject *SWIGUNUSEDPA return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_new_RangedDistributionCosine__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - size_t arg1 ; - double arg2 ; - RealLimits *arg3 = 0 ; - size_t val1 ; - int ecode1 = 0 ; - double val2 ; - int ecode2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - RangedDistributionCosine *result = 0 ; - - if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; - ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionCosine" "', argument " "1"" of type '" "size_t""'"); - } - arg1 = static_cast< size_t >(val1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RangedDistributionCosine" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_RealLimits, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RangedDistributionCosine" "', argument " "3"" of type '" "RealLimits const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RangedDistributionCosine" "', argument " "3"" of type '" "RealLimits const &""'"); - } - arg3 = reinterpret_cast< RealLimits * >(argp3); - result = (RangedDistributionCosine *)new RangedDistributionCosine(arg1,arg2,(RealLimits const &)*arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RangedDistributionCosine, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_RangedDistributionCosine__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { +SWIGINTERN PyObject *_wrap_new_RangedDistributionCosine(PyObject *self, PyObject *args) { PyObject *resultobj = 0; size_t arg1 ; double arg2 ; @@ -28776,9 +28364,10 @@ SWIGINTERN PyObject *_wrap_new_RangedDistributionCosine__SWIG_1(PyObject *self, int ecode1 = 0 ; double val2 ; int ecode2 = 0 ; + PyObject *swig_obj[2] ; RangedDistributionCosine *result = 0 ; - if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_RangedDistributionCosine", 2, 2, swig_obj)) SWIG_fail; ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RangedDistributionCosine" "', argument " "1"" of type '" "size_t""'"); @@ -28797,60 +28386,6 @@ fail: } -SWIGINTERN PyObject *_wrap_new_RangedDistributionCosine(PyObject *self, PyObject *args) { - Py_ssize_t argc; - PyObject *argv[4] = { - 0 - }; - - if (!(argc = SWIG_Python_UnpackTuple(args, "new_RangedDistributionCosine", 0, 3, argv))) SWIG_fail; - --argc; - if (argc == 2) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_RangedDistributionCosine__SWIG_1(self, argc, argv); - } - } - } - if (argc == 3) { - int _v = 0; - { - int res = SWIG_AsVal_size_t(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_RealLimits, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_RangedDistributionCosine__SWIG_0(self, argc, argv); - } - } - } - } - -fail: - SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RangedDistributionCosine'.\n" - " Possible C/C++ prototypes are:\n" - " RangedDistributionCosine::RangedDistributionCosine(size_t,double,RealLimits const &)\n" - " RangedDistributionCosine::RangedDistributionCosine(size_t,double)\n"); - return 0; -} - - SWIGINTERN PyObject *_wrap_delete_RangedDistributionCosine(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RangedDistributionCosine *arg1 = (RangedDistributionCosine *) 0 ; @@ -29627,27 +29162,27 @@ static PyMethodDef SwigMethods[] = { { "delete_ParameterDistribution", _wrap_delete_ParameterDistribution, METH_O, "delete_ParameterDistribution(ParameterDistribution self)"}, { "ParameterDistribution_swigregister", ParameterDistribution_swigregister, METH_O, NULL}, { "ParameterDistribution_swiginit", ParameterDistribution_swiginit, METH_VARARGS, NULL}, - { "new_RangedDistributionGate", _wrap_new_RangedDistributionGate, METH_VARARGS, "RangedDistributionGate(size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless())"}, + { "new_RangedDistributionGate", _wrap_new_RangedDistributionGate, METH_VARARGS, "new_RangedDistributionGate(size_t n_samples, double sigma_factor) -> RangedDistributionGate"}, { "delete_RangedDistributionGate", _wrap_delete_RangedDistributionGate, METH_O, "delete_RangedDistributionGate(RangedDistributionGate self)"}, { "RangedDistributionGate_clone", _wrap_RangedDistributionGate_clone, METH_O, "RangedDistributionGate_clone(RangedDistributionGate self) -> RangedDistributionGate"}, { "RangedDistributionGate_swigregister", RangedDistributionGate_swigregister, METH_O, NULL}, { "RangedDistributionGate_swiginit", RangedDistributionGate_swiginit, METH_VARARGS, NULL}, - { "new_RangedDistributionLorentz", _wrap_new_RangedDistributionLorentz, METH_VARARGS, "RangedDistributionLorentz(size_t n_samples, double hwhm_factor, RealLimits const & limits=RealLimits::limitless())"}, + { "new_RangedDistributionLorentz", _wrap_new_RangedDistributionLorentz, METH_VARARGS, "new_RangedDistributionLorentz(size_t n_samples, double hwhm_factor) -> RangedDistributionLorentz"}, { "delete_RangedDistributionLorentz", _wrap_delete_RangedDistributionLorentz, METH_O, "delete_RangedDistributionLorentz(RangedDistributionLorentz self)"}, { "RangedDistributionLorentz_clone", _wrap_RangedDistributionLorentz_clone, METH_O, "RangedDistributionLorentz_clone(RangedDistributionLorentz self) -> RangedDistributionLorentz"}, { "RangedDistributionLorentz_swigregister", RangedDistributionLorentz_swigregister, METH_O, NULL}, { "RangedDistributionLorentz_swiginit", RangedDistributionLorentz_swiginit, METH_VARARGS, NULL}, - { "new_RangedDistributionGaussian", _wrap_new_RangedDistributionGaussian, METH_VARARGS, "RangedDistributionGaussian(size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless())"}, + { "new_RangedDistributionGaussian", _wrap_new_RangedDistributionGaussian, METH_VARARGS, "new_RangedDistributionGaussian(size_t n_samples, double sigma_factor) -> RangedDistributionGaussian"}, { "delete_RangedDistributionGaussian", _wrap_delete_RangedDistributionGaussian, METH_O, "delete_RangedDistributionGaussian(RangedDistributionGaussian self)"}, { "RangedDistributionGaussian_clone", _wrap_RangedDistributionGaussian_clone, METH_O, "RangedDistributionGaussian_clone(RangedDistributionGaussian self) -> RangedDistributionGaussian"}, { "RangedDistributionGaussian_swigregister", RangedDistributionGaussian_swigregister, METH_O, NULL}, { "RangedDistributionGaussian_swiginit", RangedDistributionGaussian_swiginit, METH_VARARGS, NULL}, - { "new_RangedDistributionLogNormal", _wrap_new_RangedDistributionLogNormal, METH_VARARGS, "RangedDistributionLogNormal(size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless())"}, + { "new_RangedDistributionLogNormal", _wrap_new_RangedDistributionLogNormal, METH_VARARGS, "new_RangedDistributionLogNormal(size_t n_samples, double sigma_factor) -> RangedDistributionLogNormal"}, { "delete_RangedDistributionLogNormal", _wrap_delete_RangedDistributionLogNormal, METH_O, "delete_RangedDistributionLogNormal(RangedDistributionLogNormal self)"}, { "RangedDistributionLogNormal_clone", _wrap_RangedDistributionLogNormal_clone, METH_O, "RangedDistributionLogNormal_clone(RangedDistributionLogNormal self) -> RangedDistributionLogNormal"}, { "RangedDistributionLogNormal_swigregister", RangedDistributionLogNormal_swigregister, METH_O, NULL}, { "RangedDistributionLogNormal_swiginit", RangedDistributionLogNormal_swiginit, METH_VARARGS, NULL}, - { "new_RangedDistributionCosine", _wrap_new_RangedDistributionCosine, METH_VARARGS, "RangedDistributionCosine(size_t n_samples, double sigma_factor, RealLimits const & limits=RealLimits::limitless())"}, + { "new_RangedDistributionCosine", _wrap_new_RangedDistributionCosine, METH_VARARGS, "new_RangedDistributionCosine(size_t n_samples, double sigma_factor) -> RangedDistributionCosine"}, { "delete_RangedDistributionCosine", _wrap_delete_RangedDistributionCosine, METH_O, "delete_RangedDistributionCosine(RangedDistributionCosine self)"}, { "RangedDistributionCosine_clone", _wrap_RangedDistributionCosine_clone, METH_O, "RangedDistributionCosine_clone(RangedDistributionCosine self) -> RangedDistributionCosine"}, { "RangedDistributionCosine_swigregister", RangedDistributionCosine_swigregister, METH_O, NULL}, -- GitLab