diff --git a/Device/Data/Powerfield.h b/Device/Data/Powerfield.h index bf0c906fc0272f2b28af6cb771afb0c371c63e80..31e6527be84a09ad1e83fdd1deb3a4930684133f 100644 --- a/Device/Data/Powerfield.h +++ b/Device/Data/Powerfield.h @@ -32,6 +32,10 @@ using std::size_t; //! @ingroup tools class IField { +public: + //! Returns number of dimensions. + size_t rank() const { return m_axes.size(); } + protected: //! Returns serial number of axis with given name size_t getAxisIndex(const std::string& axis_name) const; @@ -67,9 +71,6 @@ public: // retrieve basic info - //! Returns number of dimensions. - size_t rank() const { return m_axes.size(); } - //! Returns total size of data buffer (product of bin number in every dimension). size_t getAllocatedSize() const { diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index 6d41b11ff7f1ee834d8a3bece874fe3b7d826095..88991d3dbe305e2b942a87547cc4242256492c15 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -1202,6 +1202,11 @@ Templated class to store data in multi-dimensional space. Used with type T = dou C++ includes: Powerfield.h "; +%feature("docstring") IField::rank "size_t IField::rank() const + +Returns number of dimensions. +"; + // File: classIFootprintFactor.xml %feature("docstring") IFootprintFactor " @@ -1890,11 +1895,6 @@ The private data for polygons to hide boost dependency from the header. Returns axis with given serial number. "; -%feature("docstring") Powerfield::rank "size_t Powerfield< T >::rank() const - -Returns number of dimensions. -"; - %feature("docstring") Powerfield::getAllocatedSize "size_t Powerfield< T >::getAllocatedSize() const Returns total size of data buffer (product of bin number in every dimension). diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 439d23944ea440696ddaa6954ca1bdddafc3d26b..a90e277144f670697fd8772a3b6170a8eeb46615 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2061,6 +2061,16 @@ class IField(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr + def rank(self): + r""" + rank(IField self) -> size_t + size_t IField::rank() const + + Returns number of dimensions. + + """ + return _libBornAgainDevice.IField_rank(self) + def __init__(self): r""" __init__(IField self) -> IField @@ -2136,16 +2146,6 @@ class IntensityData(IField): """ return _libBornAgainDevice.IntensityData_axis(self, serial_number) - def rank(self): - r""" - rank(IntensityData self) -> size_t - size_t Powerfield< T >::rank() const - - Returns number of dimensions. - - """ - return _libBornAgainDevice.IntensityData_rank(self) - def getAllocatedSize(self): r""" getAllocatedSize(IntensityData self) -> size_t diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index f9f28f64f40e9fc3ee36105d51c80086fd22cee9..cff239be3637f9648fffe7b6e5138fcfd5b28c7b 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -26992,6 +26992,29 @@ SWIGINTERN PyObject *vector_R3_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject return SWIG_Python_InitShadowInstance(args); } +SWIGINTERN PyObject *_wrap_IField_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IField *arg1 = (IField *) 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_IField, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IField_rank" "', argument " "1"" of type '" "IField const *""'"); + } + arg1 = reinterpret_cast< IField * >(argp1); + result = ((IField const *)arg1)->rank(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_new_IField(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IField *result = 0 ; @@ -27387,29 +27410,6 @@ fail: } -SWIGINTERN PyObject *_wrap_IntensityData_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Powerfield< double > *arg1 = (Powerfield< double > *) 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_PowerfieldT_double_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntensityData_rank" "', argument " "1"" of type '" "Powerfield< double > const *""'"); - } - arg1 = reinterpret_cast< Powerfield< double > * >(argp1); - result = ((Powerfield< double > const *)arg1)->rank(); - resultobj = SWIG_From_size_t(static_cast< size_t >(result)); - return resultobj; -fail: - return NULL; -} - - SWIGINTERN PyObject *_wrap_IntensityData_getAllocatedSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Powerfield< double > *arg1 = (Powerfield< double > *) 0 ; @@ -42770,6 +42770,13 @@ static PyMethodDef SwigMethods[] = { { "delete_vector_R3", _wrap_delete_vector_R3, METH_O, "delete_vector_R3(vector_R3 self)"}, { "vector_R3_swigregister", vector_R3_swigregister, METH_O, NULL}, { "vector_R3_swiginit", vector_R3_swiginit, METH_VARARGS, NULL}, + { "IField_rank", _wrap_IField_rank, METH_O, "\n" + "IField_rank(IField self) -> size_t\n" + "size_t IField::rank() const\n" + "\n" + "Returns number of dimensions. \n" + "\n" + ""}, { "new_IField", _wrap_new_IField, METH_NOARGS, "\n" "new_IField() -> IField\n" "\n" @@ -42821,13 +42828,6 @@ static PyMethodDef SwigMethods[] = { "Returns axis with given serial number. \n" "\n" ""}, - { "IntensityData_rank", _wrap_IntensityData_rank, METH_O, "\n" - "IntensityData_rank(IntensityData self) -> size_t\n" - "size_t Powerfield< T >::rank() const\n" - "\n" - "Returns number of dimensions. \n" - "\n" - ""}, { "IntensityData_getAllocatedSize", _wrap_IntensityData_getAllocatedSize, METH_O, "\n" "IntensityData_getAllocatedSize(IntensityData self) -> size_t\n" "size_t Powerfield< T >::getAllocatedSize() const\n"