1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2017 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
21 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
25 # ==============================================================================
27 for algo in ("AdjointTest", "FunctionTest", "GradientTest", "LinearityTest", "TangentTest"):
29 msg = "Algorithme en test : %s"%algo
30 print msg+"\n"+"-"*len(msg)
32 adaopy = adaoBuilder.New()
33 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={"EpsilonMinimumExponent":-10,"NumberOfRepetition":2, "SetSeed":1000})
34 adaopy.setCheckingPoint (Vector = [0,1,2])
35 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
36 adaopy.setObservation (Vector = [0.5,1.5,2.5])
37 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
38 adaopy.setObservationOperator(Matrix = "1 0 0;0 2 0;0 0 3")
42 for algo in ("ObserverTest", ):
44 msg = "Algorithme en test : %s"%algo
45 print msg+"\n"+"-"*len(msg)
47 adaopy = adaoBuilder.New()
48 adaopy.setAlgorithmParameters(Algorithm=algo)
49 adaopy.setCheckingPoint (Vector = [0,1,2])
50 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
51 adaopy.setObservation (Vector = [0.5,1.5,2.5])
52 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
53 adaopy.setObservationOperator(Matrix = "1 0 0;0 2 0;0 0 3")
54 adaopy.setObserver("Analysis",Template="ValuePrinter")
58 for algo in ("SamplingTest", ):
60 msg = "Algorithme en test : %s"%algo
61 print msg+"\n"+"-"*len(msg)
63 adaopy = adaoBuilder.New()
64 adaopy.setAlgorithmParameters(Algorithm=algo, Parameters={
65 "StoreSupplementaryCalculations":["CostFunctionJ","CurrentState",],
66 "SampleAsMinMaxStepHyperCube":[[-1.,1.,1.],[0,2,1],[1,3,1]],
68 adaopy.setCheckingPoint (Vector = [0,1,2])
69 adaopy.setBackgroundError (ScalarSparseMatrix = 1.)
70 adaopy.setObservation (Vector = [0.5,1.5,2.5])
71 adaopy.setObservationError (DiagonalSparseMatrix = "1 1 1")
72 adaopy.setObservationOperator(Matrix = "1 0 0;0 2 0;0 0 3")
73 adaopy.setObserver ("CurrentState",Template="ValuePrinter")
77 # ==============================================================================
78 if __name__ == "__main__":
79 print '\n AUTODIAGNOSTIC \n'