1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2011 EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 from daCore import BasicObjects, PlatformInfo
24 m = PlatformInfo.SystemUsage()
26 # ==============================================================================
27 class ElementaryAlgorithm(BasicObjects.Algorithm):
29 BasicObjects.Algorithm.__init__(self)
30 self._name = "LINEARLEASTSQUARES"
32 def run(self, Xb=None, Y=None, H=None, M=None, R=None, B=None, Q=None, Parameters=None):
34 Calcul de l'estimateur moindres carrés pondérés linéaires
35 (assimilation variationnelle sans ébauche)
37 logging.debug("%s Lancement"%self._name)
38 logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo")))
40 Hm = H["Direct"].asMatrix()
41 Ht = H["Adjoint"].asMatrix()
43 K = (Ht * R.I * Hm ).I * Ht * R.I
46 self.StoredVariables["Analysis"].store( Xa.A1 )
48 logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo")))
49 logging.debug("%s Terminé"%self._name)
53 # ==============================================================================
54 if __name__ == "__main__":
55 print '\n AUTODIAGNOSTIC \n'