]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Performance improvement of A covariance calculation
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Mon, 15 Oct 2012 21:51:31 +0000 (23:51 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Mon, 15 Oct 2012 21:51:31 +0000 (23:51 +0200)
src/daComposant/daAlgorithms/3DVAR.py

index e343c6450748211d2460c8cd06a52eb1878bfee6..50a104c4eb059643bbfb7f7bf1222a3e1fcc64f7 100644 (file)
@@ -255,16 +255,18 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Calcul de la covariance d'analyse
         # ---------------------------------
         if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
-            Ht = H["Tangent"].asMatrix(ValueForMethodForm = Xa)
-            Ht = Ht.reshape(-1,len(Xa.A1)) # ADAO
+            HtM = H["Tangent"].asMatrix(ValueForMethodForm = Xa)
+            HtM = HtM.reshape(len(Y),len(Xa.A1)) # ADAO & check shape
+            HaM = H["Adjoint"].asMatrix(ValueForMethodForm = Xa)
+            HaM = HaM.reshape(len(Xa.A1),len(Y)) # ADAO & check shape
             HessienneI = []
             nb = len(Xa.A1)
             for i in range(nb):
                 _ee    = numpy.matrix(numpy.zeros(nb)).T
                 _ee[i] = 1.
-                _HtEE  = Ht * _ee
+                _HtEE  = numpy.dot(HtM,_ee)
                 _HtEE  = numpy.asmatrix(numpy.ravel( _HtEE )).T
-                HessienneI.append( ( BI*_ee + Ha((Xa,RI*_HtEE)) ).A1 )
+                HessienneI.append( numpy.ravel( numpy.dot(BI,_ee) + numpy.dot(HaM,numpy.dot(RI,_HtEE)) ) )
             HessienneI = numpy.matrix( HessienneI )
             A = HessienneI.I
             if min(A.shape) != max(A.shape):