]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Minor source corrections for syntax and efficiency
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 28 May 2016 20:12:39 +0000 (22:12 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 28 May 2016 20:12:39 +0000 (22:12 +0200)
src/daComposant/daAlgorithms/3DVAR.py
src/daComposant/daAlgorithms/ExtendedBlue.py
src/daComposant/daAlgorithms/NonLinearLeastSquares.py
src/daComposant/daAlgorithms/QuantileRegression.py
src/daComposant/daCore/BasicObjects.py

index d8b2863f96f8497abf4bc1511271dc3e685ae402..70ea8441f1db24cd8ea1bcf92d35ac031bd1ec36 100644 (file)
@@ -137,7 +137,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé (sans cout)
         # ----------------------------------------------------------------
         if HO["AppliedToX"] is not None and HO["AppliedToX"].has_key("HXb"):
-            HXb = HO["AppliedToX"]["HXb"]
+            HXb = Hm( Xb, HO["AppliedToX"]["HXb"])
         else:
             HXb = Hm( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
index 7ef3b47341b9a2aaf94fa40968f6549c69c363f5..70fb69f467eac48c75acee6d59df5faca27ff0fd 100644 (file)
@@ -87,7 +87,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé
         # ----------------------------------------------------
         if HO["AppliedToX"] is not None and HO["AppliedToX"].has_key("HXb"):
-            HXb = HO["AppliedToX"]["HXb"]
+            HXb = H( Xb, HO["AppliedToX"]["HXb"])
         else:
             HXb = H( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
index 281288d9ba06fbdc7192b70473ef9ac67904c082..68fc42228773846c8859ae5dce86cf3118643927 100644 (file)
@@ -110,7 +110,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé
         # ----------------------------------------------------
         if HO["AppliedToX"] is not None and HO["AppliedToX"].has_key("HXb"):
-            HXb = HO["AppliedToX"]["HXb"]
+            HXb = Hm( Xb, HO["AppliedToX"]["HXb"])
         else:
             HXb = Hm( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
index 149a50b437f1f9f2170f6b5ff087e6a5ff71b657..eeb7499458b4140f60008d41520d9be45bfaa81e 100644 (file)
@@ -94,7 +94,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé
         # ----------------------------------------------------
         if HO["AppliedToX"] is not None and HO["AppliedToX"].has_key("HXb"):
-            HXb = HO["AppliedToX"]["HXb"]
+            HXb = Hm( Xb, HO["AppliedToX"]["HXb"])
         else:
             HXb = Hm( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
index d36104ca69fb5558cc2098717edb0560ef96911a..ca25024a9eaf6bd7aca120b14212e906e87ac764 100644 (file)
@@ -142,7 +142,7 @@ class Operator(object):
         "Renvoie le type"
         return self.__Type
 
-    def appliedTo(self, xValue):
+    def appliedTo(self, xValue, HValue = None):
         """
         Permet de restituer le résultat de l'application de l'opérateur à un
         argument xValue. Cette méthode se contente d'appliquer, son argument
@@ -150,23 +150,28 @@ class Operator(object):
         Arguments :
         - xValue : argument adapté pour appliquer l'opérateur
         """
-        if self.__AvoidRC:
-            __alreadyCalculated, __HxV = Operator.CM.wasCalculatedIn(xValue)
-        else:
-            __alreadyCalculated = False
-        #
-        if __alreadyCalculated:
-            self.__addOneCacheCall()
-            HxValue = __HxV
-        else:
-            if self.__Matrix is not None:
-                self.__addOneMatrixCall()
-                HxValue = self.__Matrix * xValue
-            else:
-                self.__addOneMethodCall()
-                HxValue = self.__Method( xValue )
+        if HValue is not None:
+            HxValue = numpy.asmatrix( numpy.ravel( HValue ) ).T
             if self.__AvoidRC:
                 Operator.CM.storeValueInX(xValue,HxValue)
+        else:
+            if self.__AvoidRC:
+                __alreadyCalculated, __HxV = Operator.CM.wasCalculatedIn(xValue)
+            else:
+                __alreadyCalculated = False
+            #
+            if __alreadyCalculated:
+                self.__addOneCacheCall()
+                HxValue = __HxV
+            else:
+                if self.__Matrix is not None:
+                    self.__addOneMatrixCall()
+                    HxValue = self.__Matrix * xValue
+                else:
+                    self.__addOneMethodCall()
+                    HxValue = self.__Method( xValue )
+                if self.__AvoidRC:
+                    Operator.CM.storeValueInX(xValue,HxValue)
         #
         return HxValue