From e972f713c1f0bff7ceeea5e91e46ce4e2f94e388 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Sun, 29 May 2022 18:30:43 +0200
Subject: [PATCH] rm unused fcts

---
 Device/Histo/IHistogram.cpp           | 13 +-----
 Device/Histo/IHistogram.h             |  6 ---
 auto/Wrap/doxygenDevice.i             | 10 -----
 auto/Wrap/libBornAgainDevice.py       | 20 ---------
 auto/Wrap/libBornAgainDevice_wrap.cpp | 60 ---------------------------
 5 files changed, 1 insertion(+), 108 deletions(-)

diff --git a/Device/Histo/IHistogram.cpp b/Device/Histo/IHistogram.cpp
index 5980b921c3c..3df19e28073 100644
--- a/Device/Histo/IHistogram.cpp
+++ b/Device/Histo/IHistogram.cpp
@@ -180,18 +180,12 @@ double IHistogram::binAverage(size_t binx, size_t biny) const
 
 double IHistogram::getMaximum() const
 {
+//    for (size_t i=0; i<allocatedSize(); ++i)
     Powerfield<CumulativeValue>::const_iterator it =
         std::max_element(m_data->begin(), m_data->end());
     return it->getContent();
 }
 
-size_t IHistogram::getMaximumBinIndex() const
-{
-    Powerfield<CumulativeValue>::const_iterator it =
-        std::max_element(m_data->begin(), m_data->end());
-    return std::distance(m_data->cbegin(), it);
-}
-
 double IHistogram::getMinimum() const
 {
     Powerfield<CumulativeValue>::const_iterator it =
@@ -199,11 +193,6 @@ double IHistogram::getMinimum() const
     return it->getContent();
 }
 
-size_t IHistogram::getMinimumBinIndex() const
-{
-    return std::distance(m_data->begin(), std::min_element(m_data->begin(), m_data->end()));
-}
-
 void IHistogram::scale(double value)
 {
     for (size_t index = 0; index < getTotalNumberOfBins(); ++index)
diff --git a/Device/Histo/IHistogram.h b/Device/Histo/IHistogram.h
index be2ba8e0f93..773dc52c779 100644
--- a/Device/Histo/IHistogram.h
+++ b/Device/Histo/IHistogram.h
@@ -124,15 +124,9 @@ public:
     //! Returns histogram maximum value (maximum of binContent() over all bins)
     double getMaximum() const;
 
-    //! Returns globalbin index with maximum content
-    size_t getMaximumBinIndex() const;
-
     //! Returns histogram minimum value (minimum of binContent() over all bins)
     double getMinimum() const;
 
-    //! Returns globalbin index with minimum content
-    size_t getMinimumBinIndex() const;
-
     //! Multiply this histogram (every bin content value) by a constant
     void scale(double value);
 
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index d52013701dc..01e1985f94d 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -1233,21 +1233,11 @@ Returns average value of the bin with given indices (for 2D histograms).
 Returns histogram maximum value (maximum of  binContent() over all bins) 
 ";
 
-%feature("docstring")  IHistogram::getMaximumBinIndex "size_t IHistogram::getMaximumBinIndex() const
-
-Returns globalbin index with maximum content. 
-";
-
 %feature("docstring")  IHistogram::getMinimum "double IHistogram::getMinimum() const
 
 Returns histogram minimum value (minimum of  binContent() over all bins) 
 ";
 
-%feature("docstring")  IHistogram::getMinimumBinIndex "size_t IHistogram::getMinimumBinIndex() const
-
-Returns globalbin index with minimum content. 
-";
-
 %feature("docstring")  IHistogram::scale "void IHistogram::scale(double value)
 
 Multiply this histogram (every bin content value) by a constant. 
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index 087fcb27b10..4ba39447875 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -4470,16 +4470,6 @@ class IHistogram(object):
         """
         return _libBornAgainDevice.IHistogram_getMaximum(self)
 
-    def getMaximumBinIndex(self):
-        r"""
-        getMaximumBinIndex(IHistogram self) -> size_t
-        size_t IHistogram::getMaximumBinIndex() const
-
-        Returns globalbin index with maximum content. 
-
-        """
-        return _libBornAgainDevice.IHistogram_getMaximumBinIndex(self)
-
     def getMinimum(self):
         r"""
         getMinimum(IHistogram self) -> double
@@ -4490,16 +4480,6 @@ class IHistogram(object):
         """
         return _libBornAgainDevice.IHistogram_getMinimum(self)
 
-    def getMinimumBinIndex(self):
-        r"""
-        getMinimumBinIndex(IHistogram self) -> size_t
-        size_t IHistogram::getMinimumBinIndex() const
-
-        Returns globalbin index with minimum content. 
-
-        """
-        return _libBornAgainDevice.IHistogram_getMinimumBinIndex(self)
-
     def scale(self, value):
         r"""
         scale(IHistogram self, double value)
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index f4faa11b15b..b8dac286e48 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -36994,29 +36994,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_IHistogram_getMaximumBinIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  IHistogram *arg1 = (IHistogram *) 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_IHistogram, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IHistogram_getMaximumBinIndex" "', argument " "1"" of type '" "IHistogram const *""'"); 
-  }
-  arg1 = reinterpret_cast< IHistogram * >(argp1);
-  result = ((IHistogram const *)arg1)->getMaximumBinIndex();
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_IHistogram_getMinimum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   IHistogram *arg1 = (IHistogram *) 0 ;
@@ -37040,29 +37017,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_IHistogram_getMinimumBinIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  IHistogram *arg1 = (IHistogram *) 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_IHistogram, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IHistogram_getMinimumBinIndex" "', argument " "1"" of type '" "IHistogram const *""'"); 
-  }
-  arg1 = reinterpret_cast< IHistogram * >(argp1);
-  result = ((IHistogram const *)arg1)->getMinimumBinIndex();
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_IHistogram_scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   IHistogram *arg1 = (IHistogram *) 0 ;
@@ -42036,13 +41990,6 @@ static PyMethodDef SwigMethods[] = {
 		"Returns histogram maximum value (maximum of  binContent() over all bins) \n"
 		"\n"
 		""},
-	 { "IHistogram_getMaximumBinIndex", _wrap_IHistogram_getMaximumBinIndex, METH_O, "\n"
-		"IHistogram_getMaximumBinIndex(IHistogram self) -> size_t\n"
-		"size_t IHistogram::getMaximumBinIndex() const\n"
-		"\n"
-		"Returns globalbin index with maximum content. \n"
-		"\n"
-		""},
 	 { "IHistogram_getMinimum", _wrap_IHistogram_getMinimum, METH_O, "\n"
 		"IHistogram_getMinimum(IHistogram self) -> double\n"
 		"double IHistogram::getMinimum() const\n"
@@ -42050,13 +41997,6 @@ static PyMethodDef SwigMethods[] = {
 		"Returns histogram minimum value (minimum of  binContent() over all bins) \n"
 		"\n"
 		""},
-	 { "IHistogram_getMinimumBinIndex", _wrap_IHistogram_getMinimumBinIndex, METH_O, "\n"
-		"IHistogram_getMinimumBinIndex(IHistogram self) -> size_t\n"
-		"size_t IHistogram::getMinimumBinIndex() const\n"
-		"\n"
-		"Returns globalbin index with minimum content. \n"
-		"\n"
-		""},
 	 { "IHistogram_scale", _wrap_IHistogram_scale, METH_VARARGS, "\n"
 		"IHistogram_scale(IHistogram self, double value)\n"
 		"void IHistogram::scale(double value)\n"
-- 
GitLab