From: Jean-Philippe ARGAUD Date: Mon, 15 Oct 2012 21:51:31 +0000 (+0200) Subject: Performance improvement of A covariance calculation X-Git-Tag: V6_6_0~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d7834b1e0cba2463cac19c4390d7ca1e1d39053c;p=modules%2Fadao.git Performance improvement of A covariance calculation --- diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index e343c64..50a104c 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -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):