diff --git a/Base/Axis/IAxis.h b/Base/Axis/IAxis.h index 368115fb6678a1c97559244450c3f2ecd83ea163..aca3485187eb3125402ec73e0569e797b038c60a 100644 --- a/Base/Axis/IAxis.h +++ b/Base/Axis/IAxis.h @@ -50,6 +50,10 @@ public: //! Returns the label of the axis std::string getName() const { return m_name; } + virtual std::vector<double> binCenters() const; + + virtual std::vector<double> binBoundaries() const; + //! indexed accessor retrieves a sample virtual double operator[](size_t index) const = 0; @@ -61,6 +65,12 @@ public: //! find bin index which is best match for given value virtual size_t findClosestIndex(double value) const = 0; + //! Returns true if axis contains given point + virtual bool contains(double value) const; + + //! Creates a new clipped axis + virtual IAxis* createClippedAxis(double left, double right) const; + //! test for equality bool operator==(const IAxis& right) const { return equals(right); } bool operator!=(const IAxis& right) const { return !(*this == right); } @@ -71,16 +81,6 @@ public: return ostr; } - virtual std::vector<double> binCenters() const; - - virtual std::vector<double> binBoundaries() const; - - //! Creates a new clipped axis - virtual IAxis* createClippedAxis(double left, double right) const; - - //! Returns true if axis contains given point - virtual bool contains(double value) const; - protected: virtual void print(std::ostream& ostr) const = 0; virtual bool equals(const IAxis& other) const; // overloaded in child classes diff --git a/Device/InputOutput/OutputDataReadWriteINT.cpp b/Device/InputOutput/OutputDataReadWriteINT.cpp index a3117f6d815c67b23c7a2531d0295fad88829dcb..0b4f2656620385eacfbe26d5e47db2fcab1f1f4a 100644 --- a/Device/InputOutput/OutputDataReadWriteINT.cpp +++ b/Device/InputOutput/OutputDataReadWriteINT.cpp @@ -58,7 +58,6 @@ void OutputDataReadWriteINT::writeOutputData(const OutputData<double>& data, void OutputDataReadWriteINT::writeOutputDataDoubles(const OutputData<double>& data, std::ostream& output_stream, size_t n_columns) { - OutputData<double>::const_iterator it = data.begin(); output_stream.imbue(std::locale::classic()); output_stream << std::scientific << std::setprecision(12); diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index 42a645956891be0c36cc336ed25f26fa5757b88a..5211cdba8eaef8ab7216035f7e4aa230db50e344 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -300,8 +300,6 @@ upper edge of last bin "; %feature("docstring") ConstKBinAxis::clone "ConstKBinAxis * ConstKBinAxis::clone() const override - -clone function "; %feature("docstring") ConstKBinAxis::createClippedAxis "ConstKBinAxis * ConstKBinAxis::createClippedAxis(double left, double right) const override @@ -342,8 +340,6 @@ center of last bin (IsGisaxs convention) "; %feature("docstring") CustomBinAxis::clone "CustomBinAxis * CustomBinAxis::clone() const - -clone function "; %feature("docstring") CustomBinAxis::bin "Bin1D CustomBinAxis::bin(size_t index) const @@ -438,13 +434,11 @@ upper edge of last bin "; %feature("docstring") FixedBinAxis::clone "FixedBinAxis * FixedBinAxis::clone() const - -clone function "; %feature("docstring") FixedBinAxis::size "size_t FixedBinAxis::size() const -retrieve the number of bins +Returns the number of bins. "; %feature("docstring") FixedBinAxis::bin "Bin1D FixedBinAxis::bin(size_t index) const @@ -526,34 +520,18 @@ prepare arrays for 2D Fourier Transformation (FT) of the given vector // File: classIAxis.xml %feature("docstring") IAxis " -Interface for one-dimensional axes. +Abstract base class for one-dimensional axes. C++ includes: IAxis.h "; %feature("docstring") IAxis::IAxis "IAxis::IAxis(const std::string &name) - -constructors -"; - -%feature("docstring") IAxis::clone "virtual IAxis* IAxis::clone() const =0 - -clone function "; %feature("docstring") IAxis::~IAxis "virtual IAxis::~IAxis() - -destructor "; -%feature("docstring") IAxis::size "virtual size_t IAxis::size() const =0 - -retrieve the number of bins -"; - -%feature("docstring") IAxis::getName "std::string IAxis::getName() const - -retrieve the label of the axis +%feature("docstring") IAxis::clone "virtual IAxis* IAxis::clone() const =0 "; %feature("docstring") IAxis::setName "void IAxis::setName(std::string name) @@ -561,9 +539,9 @@ retrieve the label of the axis Sets the axis label. "; -%feature("docstring") IAxis::bin "virtual Bin1D IAxis::bin(size_t index) const =0 +%feature("docstring") IAxis::size "virtual size_t IAxis::size() const =0 -retrieve a 1d bin for the given index +Returns the number of bins. "; %feature("docstring") IAxis::lowerBound "virtual double IAxis::lowerBound() const =0 @@ -586,12 +564,9 @@ Returns distance from first to last point. Returns midpoint of axis. "; -%feature("docstring") IAxis::binCenter "virtual double IAxis::binCenter(size_t index) const =0 -"; - -%feature("docstring") IAxis::findClosestIndex "virtual size_t IAxis::findClosestIndex(double value) const =0 +%feature("docstring") IAxis::getName "std::string IAxis::getName() const -find bin index which is best match for given value +Returns the label of the axis. "; %feature("docstring") IAxis::binCenters "std::vector< double > IAxis::binCenters() const @@ -600,9 +575,17 @@ find bin index which is best match for given value %feature("docstring") IAxis::binBoundaries "std::vector< double > IAxis::binBoundaries() const "; -%feature("docstring") IAxis::createClippedAxis "IAxis * IAxis::createClippedAxis(double left, double right) const +%feature("docstring") IAxis::bin "virtual Bin1D IAxis::bin(size_t index) const =0 -Creates a new clipped axis. +retrieve a 1d bin for the given index +"; + +%feature("docstring") IAxis::binCenter "virtual double IAxis::binCenter(size_t index) const =0 +"; + +%feature("docstring") IAxis::findClosestIndex "virtual size_t IAxis::findClosestIndex(double value) const =0 + +find bin index which is best match for given value "; %feature("docstring") IAxis::contains "bool IAxis::contains(double value) const @@ -610,6 +593,11 @@ Creates a new clipped axis. Returns true if axis contains given point. "; +%feature("docstring") IAxis::createClippedAxis "IAxis * IAxis::createClippedAxis(double left, double right) const + +Creates a new clipped axis. +"; + // File: classICloneable.xml %feature("docstring") ICloneable " @@ -1210,13 +1198,11 @@ Array of size nbins+1 containing low-edges for each bin and upper edge of last b "; %feature("docstring") VariableBinAxis::clone "VariableBinAxis * VariableBinAxis::clone() const - -clone function "; %feature("docstring") VariableBinAxis::size "size_t VariableBinAxis::size() const -retrieve the number of bins +Returns the number of bins. "; %feature("docstring") VariableBinAxis::bin "Bin1D VariableBinAxis::bin(size_t index) const diff --git a/auto/Wrap/libBornAgainBase.py b/auto/Wrap/libBornAgainBase.py index 74cd5262818c0120453a7fc09fa9c7dbaf8347c1..983f7c310c142079b26a3ac6c5c44b2edc017cba 100644 --- a/auto/Wrap/libBornAgainBase.py +++ b/auto/Wrap/libBornAgainBase.py @@ -1983,7 +1983,7 @@ class IAxis(object): r""" - Interface for one-dimensional axes. + Abstract base class for one-dimensional axes. C++ includes: IAxis.h @@ -1994,37 +1994,15 @@ class IAxis(object): def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr + __swig_destroy__ = _libBornAgainBase.delete_IAxis def clone(self): r""" clone(IAxis self) -> IAxis virtual IAxis* IAxis::clone() const =0 - clone function - """ return _libBornAgainBase.IAxis_clone(self) - __swig_destroy__ = _libBornAgainBase.delete_IAxis - - def size(self): - r""" - size(IAxis self) -> size_t - virtual size_t IAxis::size() const =0 - - retrieve the number of bins - - """ - return _libBornAgainBase.IAxis_size(self) - - def getName(self): - r""" - getName(IAxis self) -> std::string - std::string IAxis::getName() const - - retrieve the label of the axis - - """ - return _libBornAgainBase.IAxis_getName(self) def setName(self, name): r""" @@ -2036,15 +2014,15 @@ class IAxis(object): """ return _libBornAgainBase.IAxis_setName(self, name) - def bin(self, index): + def size(self): r""" - bin(IAxis self, size_t index) -> Bin1D - virtual Bin1D IAxis::bin(size_t index) const =0 + size(IAxis self) -> size_t + virtual size_t IAxis::size() const =0 - retrieve a 1d bin for the given index + Returns the number of bins. """ - return _libBornAgainBase.IAxis_bin(self, index) + return _libBornAgainBase.IAxis_size(self) def lowerBound(self): r""" @@ -2086,31 +2064,15 @@ class IAxis(object): """ return _libBornAgainBase.IAxis_center(self) - def binCenter(self, index): - r""" - binCenter(IAxis self, size_t index) -> double - virtual double IAxis::binCenter(size_t index) const =0 - - """ - return _libBornAgainBase.IAxis_binCenter(self, index) - - def findClosestIndex(self, value): + def getName(self): r""" - findClosestIndex(IAxis self, double value) -> size_t - virtual size_t IAxis::findClosestIndex(double value) const =0 + getName(IAxis self) -> std::string + std::string IAxis::getName() const - find bin index which is best match for given value + Returns the label of the axis. """ - return _libBornAgainBase.IAxis_findClosestIndex(self, value) - - def __eq__(self, right): - r"""__eq__(IAxis self, IAxis right) -> bool""" - return _libBornAgainBase.IAxis___eq__(self, right) - - def __ne__(self, right): - r"""__ne__(IAxis self, IAxis right) -> bool""" - return _libBornAgainBase.IAxis___ne__(self, right) + return _libBornAgainBase.IAxis_getName(self) def binCenters(self): r""" @@ -2128,15 +2090,33 @@ class IAxis(object): """ return _libBornAgainBase.IAxis_binBoundaries(self) - def createClippedAxis(self, left, right): + def bin(self, index): r""" - createClippedAxis(IAxis self, double left, double right) -> IAxis - IAxis * IAxis::createClippedAxis(double left, double right) const + bin(IAxis self, size_t index) -> Bin1D + virtual Bin1D IAxis::bin(size_t index) const =0 - Creates a new clipped axis. + retrieve a 1d bin for the given index """ - return _libBornAgainBase.IAxis_createClippedAxis(self, left, right) + return _libBornAgainBase.IAxis_bin(self, index) + + def binCenter(self, index): + r""" + binCenter(IAxis self, size_t index) -> double + virtual double IAxis::binCenter(size_t index) const =0 + + """ + return _libBornAgainBase.IAxis_binCenter(self, index) + + def findClosestIndex(self, value): + r""" + findClosestIndex(IAxis self, double value) -> size_t + virtual size_t IAxis::findClosestIndex(double value) const =0 + + find bin index which is best match for given value + + """ + return _libBornAgainBase.IAxis_findClosestIndex(self, value) def contains(self, value): r""" @@ -2148,6 +2128,24 @@ class IAxis(object): """ return _libBornAgainBase.IAxis_contains(self, value) + def createClippedAxis(self, left, right): + r""" + createClippedAxis(IAxis self, double left, double right) -> IAxis + IAxis * IAxis::createClippedAxis(double left, double right) const + + Creates a new clipped axis. + + """ + return _libBornAgainBase.IAxis_createClippedAxis(self, left, right) + + def __eq__(self, right): + r"""__eq__(IAxis self, IAxis right) -> bool""" + return _libBornAgainBase.IAxis___eq__(self, right) + + def __ne__(self, right): + r"""__ne__(IAxis self, IAxis right) -> bool""" + return _libBornAgainBase.IAxis___ne__(self, right) + # Register IAxis in _libBornAgainBase: _libBornAgainBase.IAxis_swigregister(IAxis) @@ -2202,8 +2200,6 @@ class VariableBinAxis(IAxis): clone(VariableBinAxis self) -> VariableBinAxis VariableBinAxis * VariableBinAxis::clone() const - clone function - """ return _libBornAgainBase.VariableBinAxis_clone(self) @@ -2212,7 +2208,7 @@ class VariableBinAxis(IAxis): size(VariableBinAxis self) -> size_t size_t VariableBinAxis::size() const - retrieve the number of bins + Returns the number of bins. """ return _libBornAgainBase.VariableBinAxis_size(self) @@ -2342,8 +2338,6 @@ class ConstKBinAxis(VariableBinAxis): clone(ConstKBinAxis self) -> ConstKBinAxis ConstKBinAxis * ConstKBinAxis::clone() const override - clone function - """ return _libBornAgainBase.ConstKBinAxis_clone(self) @@ -2404,8 +2398,6 @@ class CustomBinAxis(VariableBinAxis): clone(CustomBinAxis self) -> CustomBinAxis CustomBinAxis * CustomBinAxis::clone() const - clone function - """ return _libBornAgainBase.CustomBinAxis_clone(self) @@ -2484,8 +2476,6 @@ class FixedBinAxis(IAxis): clone(FixedBinAxis self) -> FixedBinAxis FixedBinAxis * FixedBinAxis::clone() const - clone function - """ return _libBornAgainBase.FixedBinAxis_clone(self) @@ -2494,7 +2484,7 @@ class FixedBinAxis(IAxis): size(FixedBinAxis self) -> size_t size_t FixedBinAxis::size() const - retrieve the number of bins + Returns the number of bins. """ return _libBornAgainBase.FixedBinAxis_size(self) diff --git a/auto/Wrap/libBornAgainBase_wrap.cpp b/auto/Wrap/libBornAgainBase_wrap.cpp index 1ba716ca029730195503c1486cbe75f0b0f36bf6..635c6dc12e0e7684137c69e5e37be14311cc86c7 100644 --- a/auto/Wrap/libBornAgainBase_wrap.cpp +++ b/auto/Wrap/libBornAgainBase_wrap.cpp @@ -25557,29 +25557,6 @@ SWIGINTERN PyObject *Bin1DCVector_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObj return SWIG_Python_InitShadowInstance(args); } -SWIGINTERN PyObject *_wrap_IAxis_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - IAxis *arg1 = (IAxis *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - IAxis *result = 0 ; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_clone" "', argument " "1"" of type '" "IAxis const *""'"); - } - arg1 = reinterpret_cast< IAxis * >(argp1); - result = (IAxis *)((IAxis const *)arg1)->clone(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IAxis, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_delete_IAxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; @@ -25602,46 +25579,23 @@ fail: } -SWIGINTERN PyObject *_wrap_IAxis_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - IAxis *arg1 = (IAxis *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject *swig_obj[1] ; - size_t result; - - if (!args) SWIG_fail; - swig_obj[0] = args; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_size" "', argument " "1"" of type '" "IAxis const *""'"); - } - arg1 = reinterpret_cast< IAxis * >(argp1); - result = ((IAxis const *)arg1)->size(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_IAxis_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; - std::string result; + IAxis *result = 0 ; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_getName" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_clone" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - result = ((IAxis const *)arg1)->getName(); - resultobj = SWIG_From_std_string(static_cast< std::string >(result)); + result = (IAxis *)((IAxis const *)arg1)->clone(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IAxis, 0 | 0 ); return resultobj; fail: return NULL; @@ -25679,30 +25633,23 @@ fail: } -SWIGINTERN PyObject *_wrap_IAxis_bin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - Bin1D result; + PyObject *swig_obj[1] ; + size_t result; - if (!SWIG_Python_UnpackTuple(args, "IAxis_bin", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_bin" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_size" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_bin" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = ((IAxis const *)arg1)->bin(arg2); - resultobj = SWIG_NewPointerObj((new Bin1D(static_cast< const Bin1D& >(result))), SWIGTYPE_p_Bin1D, SWIG_POINTER_OWN | 0 ); + result = ((IAxis const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; @@ -25801,176 +25748,189 @@ fail: } -SWIGINTERN PyObject *_wrap_IAxis_binCenter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - double result; + PyObject *swig_obj[1] ; + std::string result; - if (!SWIG_Python_UnpackTuple(args, "IAxis_binCenter", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binCenter" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_getName" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_binCenter" "', argument " "2"" of type '" "size_t""'"); - } - arg2 = static_cast< size_t >(val2); - result = (double)((IAxis const *)arg1)->binCenter(arg2); - resultobj = SWIG_From_double(static_cast< double >(result)); + result = ((IAxis const *)arg1)->getName(); + resultobj = SWIG_From_std_string(static_cast< std::string >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IAxis_findClosestIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_binCenters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - PyObject *swig_obj[2] ; - size_t result; + PyObject *swig_obj[1] ; + std::vector< double,std::allocator< double > > result; - if (!SWIG_Python_UnpackTuple(args, "IAxis_findClosestIndex", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_findClosestIndex" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binCenters" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_findClosestIndex" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - result = ((IAxis const *)arg1)->findClosestIndex(arg2); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + result = ((IAxis const *)arg1)->binCenters(); + resultobj = swig::from(static_cast< std::vector< double,std::allocator< double > > >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IAxis___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_binBoundaries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - IAxis *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject *swig_obj[2] ; - bool result; + PyObject *swig_obj[1] ; + std::vector< double,std::allocator< double > > result; - if (!SWIG_Python_UnpackTuple(args, "IAxis___eq__", 2, 2, swig_obj)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis___eq__" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binBoundaries" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IAxis___eq__" "', argument " "2"" of type '" "IAxis const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IAxis___eq__" "', argument " "2"" of type '" "IAxis const &""'"); - } - arg2 = reinterpret_cast< IAxis * >(argp2); - result = (bool)((IAxis const *)arg1)->operator ==((IAxis const &)*arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); + result = ((IAxis const *)arg1)->binBoundaries(); + resultobj = swig::from(static_cast< std::vector< double,std::allocator< double > > >(result)); return resultobj; fail: - PyErr_Clear(); - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + return NULL; } -SWIGINTERN PyObject *_wrap_IAxis___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_bin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - IAxis *arg2 = 0 ; + size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; + size_t val2 ; + int ecode2 = 0 ; PyObject *swig_obj[2] ; - bool result; + Bin1D result; - if (!SWIG_Python_UnpackTuple(args, "IAxis___ne__", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "IAxis_bin", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis___ne__" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_bin" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IAxis___ne__" "', argument " "2"" of type '" "IAxis const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IAxis___ne__" "', argument " "2"" of type '" "IAxis const &""'"); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_bin" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + result = ((IAxis const *)arg1)->bin(arg2); + resultobj = SWIG_NewPointerObj((new Bin1D(static_cast< const Bin1D& >(result))), SWIGTYPE_p_Bin1D, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IAxis_binCenter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IAxis *arg1 = (IAxis *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + double result; + + if (!SWIG_Python_UnpackTuple(args, "IAxis_binCenter", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binCenter" "', argument " "1"" of type '" "IAxis const *""'"); } - arg2 = reinterpret_cast< IAxis * >(argp2); - result = (bool)((IAxis const *)arg1)->operator !=((IAxis const &)*arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); + arg1 = reinterpret_cast< IAxis * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_binCenter" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + result = (double)((IAxis const *)arg1)->binCenter(arg2); + resultobj = SWIG_From_double(static_cast< double >(result)); return resultobj; fail: - PyErr_Clear(); - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; + return NULL; } -SWIGINTERN PyObject *_wrap_IAxis_binCenters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_findClosestIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - std::vector< double,std::allocator< double > > result; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + size_t result; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "IAxis_findClosestIndex", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binCenters" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_findClosestIndex" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - result = ((IAxis const *)arg1)->binCenters(); - resultobj = swig::from(static_cast< std::vector< double,std::allocator< double > > >(result)); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_findClosestIndex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = ((IAxis const *)arg1)->findClosestIndex(arg2); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_IAxis_binBoundaries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; + double arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject *swig_obj[1] ; - std::vector< double,std::allocator< double > > result; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + bool result; - if (!args) SWIG_fail; - swig_obj[0] = args; + if (!SWIG_Python_UnpackTuple(args, "IAxis_contains", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_binBoundaries" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_contains" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - result = ((IAxis const *)arg1)->binBoundaries(); - resultobj = swig::from(static_cast< std::vector< double,std::allocator< double > > >(result)); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_contains" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (bool)((IAxis const *)arg1)->contains(arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: return NULL; @@ -26015,33 +25975,73 @@ fail: } -SWIGINTERN PyObject *_wrap_IAxis_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IAxis___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IAxis *arg1 = (IAxis *) 0 ; - double arg2 ; + IAxis *arg2 = 0 ; void *argp1 = 0 ; int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject *swig_obj[2] ; bool result; - if (!SWIG_Python_UnpackTuple(args, "IAxis_contains", 2, 2, swig_obj)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "IAxis___eq__", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis_contains" "', argument " "1"" of type '" "IAxis const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis___eq__" "', argument " "1"" of type '" "IAxis const *""'"); } arg1 = reinterpret_cast< IAxis * >(argp1); - ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IAxis_contains" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - result = (bool)((IAxis const *)arg1)->contains(arg2); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IAxis___eq__" "', argument " "2"" of type '" "IAxis const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IAxis___eq__" "', argument " "2"" of type '" "IAxis const &""'"); + } + arg2 = reinterpret_cast< IAxis * >(argp2); + result = (bool)((IAxis const *)arg1)->operator ==((IAxis const &)*arg2); resultobj = SWIG_From_bool(static_cast< bool >(result)); return resultobj; fail: - return NULL; + PyErr_Clear(); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; +} + + +SWIGINTERN PyObject *_wrap_IAxis___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IAxis *arg1 = (IAxis *) 0 ; + IAxis *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + bool result; + + if (!SWIG_Python_UnpackTuple(args, "IAxis___ne__", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IAxis, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IAxis___ne__" "', argument " "1"" of type '" "IAxis const *""'"); + } + arg1 = reinterpret_cast< IAxis * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_IAxis, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IAxis___ne__" "', argument " "2"" of type '" "IAxis const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IAxis___ne__" "', argument " "2"" of type '" "IAxis const &""'"); + } + arg2 = reinterpret_cast< IAxis * >(argp2); + result = (bool)((IAxis const *)arg1)->operator !=((IAxis const &)*arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + PyErr_Clear(); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } @@ -33017,32 +33017,14 @@ static PyMethodDef SwigMethods[] = { { "delete_Bin1DCVector", _wrap_delete_Bin1DCVector, METH_O, "delete_Bin1DCVector(Bin1DCVector self)"}, { "Bin1DCVector_swigregister", Bin1DCVector_swigregister, METH_O, NULL}, { "Bin1DCVector_swiginit", Bin1DCVector_swiginit, METH_VARARGS, NULL}, - { "IAxis_clone", _wrap_IAxis_clone, METH_O, "\n" - "IAxis_clone(IAxis self) -> IAxis\n" - "virtual IAxis* IAxis::clone() const =0\n" - "\n" - "clone function \n" - "\n" - ""}, { "delete_IAxis", _wrap_delete_IAxis, METH_O, "\n" "delete_IAxis(IAxis self)\n" "virtual IAxis::~IAxis()\n" "\n" - "destructor \n" - "\n" ""}, - { "IAxis_size", _wrap_IAxis_size, METH_O, "\n" - "IAxis_size(IAxis self) -> size_t\n" - "virtual size_t IAxis::size() const =0\n" - "\n" - "retrieve the number of bins \n" - "\n" - ""}, - { "IAxis_getName", _wrap_IAxis_getName, METH_O, "\n" - "IAxis_getName(IAxis self) -> std::string\n" - "std::string IAxis::getName() const\n" - "\n" - "retrieve the label of the axis \n" + { "IAxis_clone", _wrap_IAxis_clone, METH_O, "\n" + "IAxis_clone(IAxis self) -> IAxis\n" + "virtual IAxis* IAxis::clone() const =0\n" "\n" ""}, { "IAxis_setName", _wrap_IAxis_setName, METH_VARARGS, "\n" @@ -33052,11 +33034,11 @@ static PyMethodDef SwigMethods[] = { "Sets the axis label. \n" "\n" ""}, - { "IAxis_bin", _wrap_IAxis_bin, METH_VARARGS, "\n" - "IAxis_bin(IAxis self, size_t index) -> Bin1D\n" - "virtual Bin1D IAxis::bin(size_t index) const =0\n" + { "IAxis_size", _wrap_IAxis_size, METH_O, "\n" + "IAxis_size(IAxis self) -> size_t\n" + "virtual size_t IAxis::size() const =0\n" "\n" - "retrieve a 1d bin for the given index \n" + "Returns the number of bins. \n" "\n" ""}, { "IAxis_lowerBound", _wrap_IAxis_lowerBound, METH_O, "\n" @@ -33087,20 +33069,13 @@ static PyMethodDef SwigMethods[] = { "Returns midpoint of axis. \n" "\n" ""}, - { "IAxis_binCenter", _wrap_IAxis_binCenter, METH_VARARGS, "\n" - "IAxis_binCenter(IAxis self, size_t index) -> double\n" - "virtual double IAxis::binCenter(size_t index) const =0\n" - "\n" - ""}, - { "IAxis_findClosestIndex", _wrap_IAxis_findClosestIndex, METH_VARARGS, "\n" - "IAxis_findClosestIndex(IAxis self, double value) -> size_t\n" - "virtual size_t IAxis::findClosestIndex(double value) const =0\n" + { "IAxis_getName", _wrap_IAxis_getName, METH_O, "\n" + "IAxis_getName(IAxis self) -> std::string\n" + "std::string IAxis::getName() const\n" "\n" - "find bin index which is best match for given value \n" + "Returns the label of the axis. \n" "\n" ""}, - { "IAxis___eq__", _wrap_IAxis___eq__, METH_VARARGS, "IAxis___eq__(IAxis self, IAxis right) -> bool"}, - { "IAxis___ne__", _wrap_IAxis___ne__, METH_VARARGS, "IAxis___ne__(IAxis self, IAxis right) -> bool"}, { "IAxis_binCenters", _wrap_IAxis_binCenters, METH_O, "\n" "IAxis_binCenters(IAxis self) -> vdouble1d_t\n" "std::vector< double > IAxis::binCenters() const\n" @@ -33111,11 +33086,23 @@ static PyMethodDef SwigMethods[] = { "std::vector< double > IAxis::binBoundaries() const\n" "\n" ""}, - { "IAxis_createClippedAxis", _wrap_IAxis_createClippedAxis, METH_VARARGS, "\n" - "IAxis_createClippedAxis(IAxis self, double left, double right) -> IAxis\n" - "IAxis * IAxis::createClippedAxis(double left, double right) const\n" + { "IAxis_bin", _wrap_IAxis_bin, METH_VARARGS, "\n" + "IAxis_bin(IAxis self, size_t index) -> Bin1D\n" + "virtual Bin1D IAxis::bin(size_t index) const =0\n" "\n" - "Creates a new clipped axis. \n" + "retrieve a 1d bin for the given index \n" + "\n" + ""}, + { "IAxis_binCenter", _wrap_IAxis_binCenter, METH_VARARGS, "\n" + "IAxis_binCenter(IAxis self, size_t index) -> double\n" + "virtual double IAxis::binCenter(size_t index) const =0\n" + "\n" + ""}, + { "IAxis_findClosestIndex", _wrap_IAxis_findClosestIndex, METH_VARARGS, "\n" + "IAxis_findClosestIndex(IAxis self, double value) -> size_t\n" + "virtual size_t IAxis::findClosestIndex(double value) const =0\n" + "\n" + "find bin index which is best match for given value \n" "\n" ""}, { "IAxis_contains", _wrap_IAxis_contains, METH_VARARGS, "\n" @@ -33125,6 +33112,15 @@ static PyMethodDef SwigMethods[] = { "Returns true if axis contains given point. \n" "\n" ""}, + { "IAxis_createClippedAxis", _wrap_IAxis_createClippedAxis, METH_VARARGS, "\n" + "IAxis_createClippedAxis(IAxis self, double left, double right) -> IAxis\n" + "IAxis * IAxis::createClippedAxis(double left, double right) const\n" + "\n" + "Creates a new clipped axis. \n" + "\n" + ""}, + { "IAxis___eq__", _wrap_IAxis___eq__, METH_VARARGS, "IAxis___eq__(IAxis self, IAxis right) -> bool"}, + { "IAxis___ne__", _wrap_IAxis___ne__, METH_VARARGS, "IAxis___ne__(IAxis self, IAxis right) -> bool"}, { "IAxis_swigregister", IAxis_swigregister, METH_O, NULL}, { "HaveSameNameAndShape", _wrap_HaveSameNameAndShape, METH_VARARGS, "\n" "HaveSameNameAndShape(IAxis left, IAxis right) -> bool\n" @@ -33161,14 +33157,12 @@ static PyMethodDef SwigMethods[] = { "VariableBinAxis_clone(VariableBinAxis self) -> VariableBinAxis\n" "VariableBinAxis * VariableBinAxis::clone() const\n" "\n" - "clone function \n" - "\n" ""}, { "VariableBinAxis_size", _wrap_VariableBinAxis_size, METH_O, "\n" "VariableBinAxis_size(VariableBinAxis self) -> size_t\n" "size_t VariableBinAxis::size() const\n" "\n" - "retrieve the number of bins \n" + "Returns the number of bins. \n" "\n" ""}, { "VariableBinAxis_bin", _wrap_VariableBinAxis_bin, METH_VARARGS, "\n" @@ -33255,8 +33249,6 @@ static PyMethodDef SwigMethods[] = { "ConstKBinAxis_clone(ConstKBinAxis self) -> ConstKBinAxis\n" "ConstKBinAxis * ConstKBinAxis::clone() const override\n" "\n" - "clone function \n" - "\n" ""}, { "ConstKBinAxis_createClippedAxis", _wrap_ConstKBinAxis_createClippedAxis, METH_VARARGS, "\n" "ConstKBinAxis_createClippedAxis(ConstKBinAxis self, double left, double right) -> ConstKBinAxis\n" @@ -33298,8 +33290,6 @@ static PyMethodDef SwigMethods[] = { "CustomBinAxis_clone(CustomBinAxis self) -> CustomBinAxis\n" "CustomBinAxis * CustomBinAxis::clone() const\n" "\n" - "clone function \n" - "\n" ""}, { "CustomBinAxis_bin", _wrap_CustomBinAxis_bin, METH_VARARGS, "\n" "CustomBinAxis_bin(CustomBinAxis self, size_t index) -> Bin1D\n" @@ -33353,14 +33343,12 @@ static PyMethodDef SwigMethods[] = { "FixedBinAxis_clone(FixedBinAxis self) -> FixedBinAxis\n" "FixedBinAxis * FixedBinAxis::clone() const\n" "\n" - "clone function \n" - "\n" ""}, { "FixedBinAxis_size", _wrap_FixedBinAxis_size, METH_O, "\n" "FixedBinAxis_size(FixedBinAxis self) -> size_t\n" "size_t FixedBinAxis::size() const\n" "\n" - "retrieve the number of bins \n" + "Returns the number of bins. \n" "\n" ""}, { "FixedBinAxis_bin", _wrap_FixedBinAxis_bin, METH_VARARGS, "\n"