1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2009 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
22 Algorithme de moindre carres pondérés (analyse sans ebauche)
24 __author__ = "Sophie RICCI, Jean-Philippe ARGAUD - Septembre 2008"
26 import sys ; sys.path.insert(0, "../daCore")
29 from BasicObjects import Algorithm
30 import PlatformInfo ; m = PlatformInfo.SystemUsage()
32 # ==============================================================================
33 class ElementaryAlgorithm(Algorithm):
35 Algorithm.__init__(self)
36 self._name = "LINEARLEASTSQUARES"
38 def run(self, Xb=None, Y=None, H=None, M=None, R=None, B=None, Q=None, Par=None):
40 Calcul de l'estimateur au sens des moindres carres sans ebauche
42 logging.debug("%s Lancement"%self._name)
43 logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo")))
45 Hm = H["Direct"].asMatrix()
46 Ht = H["Adjoint"].asMatrix()
48 K = (Ht * R.I * Hm ).I * Ht * R.I
51 self.StoredVariables["Analysis"].store( Xa.A1 )
53 logging.debug("%s Taille mémoire utilisée de %.1f Mo"%(self._name, m.getUsedMemory("Mo")))
54 logging.debug("%s Terminé"%self._name)
58 # ==============================================================================
59 if __name__ == "__main__":
60 print '\n AUTODIAGNOSTIC \n'