From c668c69205f8c6044facd3ef3ecfd192c82e753f Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Tue, 19 Apr 2016 18:17:04 +0200
Subject: [PATCH] Comments in FitKernel.h

---
 Core/PythonAPI/libBornAgainCore.py       |  4 +-
 Core/PythonAPI/libBornAgainCore_wrap.cxx | 54 ++++++++++++------------
 Fit/FitKernel/FitKernel.h                | 33 +++++++--------
 3 files changed, 44 insertions(+), 47 deletions(-)

diff --git a/Core/PythonAPI/libBornAgainCore.py b/Core/PythonAPI/libBornAgainCore.py
index 2fb19d95c21..ae95e45d267 100644
--- a/Core/PythonAPI/libBornAgainCore.py
+++ b/Core/PythonAPI/libBornAgainCore.py
@@ -21369,8 +21369,6 @@ class RealParameterWrapper(_object):
             self.this.append(this)
         except:
             self.this = this
-    __swig_destroy__ = _libBornAgainCore.delete_RealParameterWrapper
-    __del__ = lambda self: None
 
     def setValue(self, value):
         """
@@ -21439,6 +21437,8 @@ class RealParameterWrapper(_object):
         """__ne__(RealParameterWrapper self, RealParameterWrapper other) -> bool"""
         return _libBornAgainCore.RealParameterWrapper___ne__(self, other)
 
+    __swig_destroy__ = _libBornAgainCore.delete_RealParameterWrapper
+    __del__ = lambda self: None
 RealParameterWrapper_swigregister = _libBornAgainCore.RealParameterWrapper_swigregister
 RealParameterWrapper_swigregister(RealParameterWrapper)
 
diff --git a/Core/PythonAPI/libBornAgainCore_wrap.cxx b/Core/PythonAPI/libBornAgainCore_wrap.cxx
index 6e3a2d1c9e6..33079209033 100644
--- a/Core/PythonAPI/libBornAgainCore_wrap.cxx
+++ b/Core/PythonAPI/libBornAgainCore_wrap.cxx
@@ -86581,27 +86581,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_RealParameterWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  RealParameterWrapper *arg1 = (RealParameterWrapper *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject * obj0 = 0 ;
-  
-  if (!PyArg_ParseTuple(args,(char *)"O:delete_RealParameterWrapper",&obj0)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RealParameterWrapper, SWIG_POINTER_DISOWN |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RealParameterWrapper" "', argument " "1"" of type '" "RealParameterWrapper *""'"); 
-  }
-  arg1 = reinterpret_cast< RealParameterWrapper * >(argp1);
-  delete arg1;
-  resultobj = SWIG_Py_Void();
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_RealParameterWrapper_setValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   RealParameterWrapper *arg1 = (RealParameterWrapper *) 0 ;
@@ -86788,6 +86767,27 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_delete_RealParameterWrapper(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  RealParameterWrapper *arg1 = (RealParameterWrapper *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_RealParameterWrapper",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RealParameterWrapper, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RealParameterWrapper" "', argument " "1"" of type '" "RealParameterWrapper *""'"); 
+  }
+  arg1 = reinterpret_cast< RealParameterWrapper * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *RealParameterWrapper_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
@@ -101299,12 +101299,6 @@ static PyMethodDef SwigMethods[] = {
 		"RealParameterWrapper::RealParameterWrapper(const RealParameterWrapper &other)\n"
 		"\n"
 		""},
-	 { (char *)"delete_RealParameterWrapper", _wrap_delete_RealParameterWrapper, METH_VARARGS, (char *)"\n"
-		"delete_RealParameterWrapper(RealParameterWrapper self)\n"
-		"\n"
-		"RealParameterWrapper::~RealParameterWrapper()\n"
-		"\n"
-		""},
 	 { (char *)"RealParameterWrapper_setValue", _wrap_RealParameterWrapper_setValue, METH_VARARGS, (char *)"\n"
 		"RealParameterWrapper_setValue(RealParameterWrapper self, double value) -> bool\n"
 		"\n"
@@ -101345,6 +101339,12 @@ static PyMethodDef SwigMethods[] = {
 		""},
 	 { (char *)"RealParameterWrapper___eq__", _wrap_RealParameterWrapper___eq__, METH_VARARGS, (char *)"RealParameterWrapper___eq__(RealParameterWrapper self, RealParameterWrapper other) -> bool"},
 	 { (char *)"RealParameterWrapper___ne__", _wrap_RealParameterWrapper___ne__, METH_VARARGS, (char *)"RealParameterWrapper___ne__(RealParameterWrapper self, RealParameterWrapper other) -> bool"},
+	 { (char *)"delete_RealParameterWrapper", _wrap_delete_RealParameterWrapper, METH_VARARGS, (char *)"\n"
+		"delete_RealParameterWrapper(RealParameterWrapper self)\n"
+		"\n"
+		"RealParameterWrapper::~RealParameterWrapper()\n"
+		"\n"
+		""},
 	 { (char *)"RealParameterWrapper_swigregister", RealParameterWrapper_swigregister, METH_VARARGS, NULL},
 	 { (char *)"new_Rectangle", _wrap_new_Rectangle, METH_VARARGS, (char *)"\n"
 		"new_Rectangle(double xlow, double ylow, double xup, double yup) -> Rectangle\n"
diff --git a/Fit/FitKernel/FitKernel.h b/Fit/FitKernel/FitKernel.h
index da59986a3e3..6df72a1cecf 100644
--- a/Fit/FitKernel/FitKernel.h
+++ b/Fit/FitKernel/FitKernel.h
@@ -22,19 +22,15 @@
 #include "FitSuiteParameters.h"
 #include "FitSuiteStrategies.h"
 #include "ChiSquaredModule.h"
-#include "IMinimizer.h"
 #include "IObserver.h"
+
 #include <string>
-#include <boost/date_time/posix_time/posix_time.hpp>
 #include <memory>
+#include <boost/date_time/posix_time/posix_time.hpp>
 #ifndef GCCXML_SKIP_THIS
 #include <atomic>
 #endif
 
-class GISASSimulation;
-class ParameterPool;
-class FitSuite;
-
 //! @class FitKernel
 //! @ingroup fitting_internal
 //! @brief Fitting kernel for FitSuite
@@ -42,14 +38,14 @@ class FitSuite;
 class BA_CORE_API_ FitKernel
 {
  public:
-    FitKernel(FitSuite *fit_suite);
+    FitKernel(class FitSuite *fit_suite);
     virtual ~FitKernel();
 
-    //! clear all and prepare for the next fit
+    //! Resets most state variables, to get prepared for the next fit
     void clear();
 
     //! Adds pair of (simulation, real data) for consecutive simulation
-    void addSimulationAndRealData(const GISASSimulation& simulation,
+    void addSimulationAndRealData(const class GISASSimulation& simulation,
                                   const OutputData<double>& real_data,
                                   double weight);
 
@@ -62,15 +58,15 @@ class BA_CORE_API_ FitKernel
     void addFitStrategy(const IFitStrategy &strategy);
 
     //! Sets minimizer
-    void setMinimizer(IMinimizer *minimizer);
+    void setMinimizer(class IMinimizer *minimizer);
 
     //! Returns minimizer
-    IMinimizer *getMinimizer();
+    class IMinimizer *getMinimizer();
 
-    //! run fitting which may consist of several minimization rounds
+    //! Runs a fit, which may consist of several minimization rounds
     virtual void runFit();
 
-    //! run single minimization round (called by FitSuiteStrategy)
+    //! Runs a single minimization round (called by FitSuiteStrategy)
     void minimize();
 
     //! Returns reference to the kit with data
@@ -92,10 +88,13 @@ class BA_CORE_API_ FitKernel
     //! Returns the number of current strategy
     size_t getCurrentStrategyIndex() const;
 
-    //! Prints results of the screen
+    //! Prints fit results to stdout
     void printResults() const;
 
+    //! Returns current fit options
     FitOptions &getOptions();
+
+    //! Sets fit options
     void setOptions(const FitOptions &fit_options);
 
     //! Returns total wall time in seconds which was spend for run fit
@@ -120,7 +119,7 @@ private:
     FitSuiteObjects m_fit_objects;
     FitSuiteParameters m_fit_parameters;
     FitSuiteStrategies m_fit_strategies;
-    std::unique_ptr<IMinimizer>  m_minimizer;
+    std::unique_ptr<class IMinimizer> m_minimizer;
     FitSuiteChiSquaredFunction m_function_chi2;
     FitSuiteGradientFunction m_function_gradient;
     bool m_is_last_iteration;
@@ -129,9 +128,7 @@ private:
 #endif
     boost::posix_time::ptime m_start_time;
     boost::posix_time::ptime m_end_time;
-    FitSuite *m_fit_suite;
+    class FitSuite *m_fit_suite;
 };
 
 #endif // FITKERNEL_H
-
-
-- 
GitLab