]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Improving robustness of the BLUE algorithm
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Mon, 17 Jun 2013 08:32:18 +0000 (10:32 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Mon, 17 Jun 2013 08:32:18 +0000 (10:32 +0200)
src/daComposant/daAlgorithms/Blue.py

index 915c51f4912704a785bfcc2cbc5cde3fab9123f3..f4fe6a92dd04daf6a756fb659cab65b5ed16ef08 100644 (file)
@@ -96,11 +96,22 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # --------------------------------------------
         if Y.size <= Xb.size:
             if self._parameters["R_scalar"] is not None:
-                R = self._parameters["R_scalar"] * numpy.eye(len(Y), dtype=numpy.float)
-            K  = B * Ha * (Hm * B * Ha + R).I
+                R = self._parameters["R_scalar"] * numpy.eye(Y.size, dtype=numpy.float)
+            if Y.size > 100: # len(R)
+                _A = Hm * B * Ha + R
+                _u = numpy.linalg.solve( _A , d )
+                Xa = Xb + B * Ha * _u
+            else:
+                K  = B * Ha * (Hm * B * Ha + R).I
+                Xa = Xb + K*d
         else:
-            K = (Ha * RI * Hm + BI).I * Ha * RI
-        Xa = Xb + K*d
+            if Y.size > 100: # len(R)
+                _A = Ha * RI * Hm + BI
+                _u = numpy.linalg.solve( _A , Ha * RI * d )
+                Xa = Xb + _u
+            else:
+                K = (Ha * RI * Hm + BI).I * Ha * RI
+                Xa = Xb + K*d
         self.StoredVariables["Analysis"].store( Xa.A1 )
         #
         # Calcul de la fonction coût