Salome HOME
Updating version and copyright date information
[modules/adao.git] / src / daComposant / daAlgorithms / NonLinearLeastSquares.py
index 231764c14cdf3e6cb73ec9c9f35261f7a9e0a6dd..54c03361a700b13140350270a4ec107a2455e0f7 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2020 EDF R&D
+# Copyright (C) 2008-2021 EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -83,6 +83,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 "CostFunctionJbAtCurrentOptimum",
                 "CostFunctionJo",
                 "CostFunctionJoAtCurrentOptimum",
+                "CurrentIterationNumber",
                 "CurrentOptimum",
                 "CurrentState",
                 "IndexOfOptimum",
@@ -110,7 +111,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             ))
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
-        self._pre_run(Parameters, Xb, Y, R, B, Q)
+        self._pre_run(Parameters, Xb, Y, U, HO, EM, CM, R, B, Q)
         #
         # Correction pour pallier a un bug de TNC sur le retour du Minimum
         if "Minimizer" in self._parameters and self._parameters["Minimizer"] == "TNC":
@@ -160,6 +161,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             Jo  = float( 0.5 * _Innovation.T * RI * _Innovation )
             J   = Jb + Jo
             #
+            self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["CostFunctionJ"]) )
             self.StoredVariables["CostFunctionJb"].store( Jb )
             self.StoredVariables["CostFunctionJo"].store( Jo )
             self.StoredVariables["CostFunctionJ" ].store( J )