Skip to content
Snippets Groups Projects

Update test/tester_algo_newton.jl

Merged smauran requested to merge smauran-master-patch-46780 into master
1 file
+ 21
0
Compare changes
  • Side-by-side
  • Inline
@@ -43,6 +43,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"cauchy","fonction 1","x011",x_min11,fmin11, flag11,sol_exacte_fct1,nb_iters11)
end
@test isapprox(x_min11,sol_exacte_fct1 ,atol=tol_erreur)
@test flag11 == 2
@test nb_iters11 == 26
# cas de test 2
x_min12, fmin12, flag12, nb_iters12 = Regions_De_Confiance("cauchy",fct1,grad_fct1,hess_fct1,pts1.x012,options1)
@@ -50,6 +52,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"cauchy","fonction 1","x012",x_min12,fmin12, flag11,sol_exacte_fct1,nb_iters12)
end
@test x_min12 sol_exacte_fct1 atol=tol_erreur
@test flag12 == 2
@test nb_iters12 == 28
# cas de test 3
x_min21, fmin21, flag21, nb_iters21, = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x021,options2)
@@ -57,6 +61,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"cauchy","fonction 2","x021",x_min21,fmin21, flag21,sol_exacte_fct2,nb_iters21)
end
@test x_min21 sol_exacte_fct2 atol=tol_erreur
@test flag21 == 2
@test nb_iters21 == 4144
# cas de test 4
x_min22, fmin22, flag22, nb_iters22 = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x022,options2)
@@ -65,6 +71,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"cauchy","fonction 2","x022",x_min22,fmin22, flag22,sol_exacte_fct2,nb_iters22)
end
@test x_min22 sol_exacte_fct2 atol=tol_erreur
@test flag22 == 0
@test nb_iters22 == 864
# cas de test 5
x_min23, fmin23, flag23, nb_iters23 = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x023,options2)
@@ -72,6 +80,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"cauchy","fonction 2","x023",x_min23,fmin23, flag23,sol_exacte_fct2,nb_iters23)
end
@test x_min23 sol_exacte_fct2 atol=tol_erreur
@test flag23 == 2
@test nb_iters23 == 3305
end
###################################################
@@ -85,6 +95,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"gct","fonction 1","x011",x_min11,fmin11, flag11,sol_exacte_fct1,nb_iters11)
end
@test isapprox(x_min11,sol_exacte_fct1 ,atol=tol_erreur)
@test flag11 == 0
@test nb_iters11 == 1
# cas de test 2
x_min12, fmin12, flag12, nb_iters12 = Regions_De_Confiance("gct",fct1,grad_fct1,hess_fct1,pts1.x012,options1)
@@ -92,6 +104,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"gct","fonction 1","x012",x_min12,fmin12, flag12,sol_exacte_fct1,nb_iters12)
end
@test x_min12 ≈ sol_exacte_fct1 atol=tol_erreur
@test flag12 = 0
@test nb_iters12 == 3
# cas de test 3
x_min21, fmin21, flag21, nb_iters21 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x021,options2)
@@ -99,6 +113,9 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"gct","fonction 2","x021",x_min21,fmin21, flag21,sol_exacte_fct2,nb_iters21)
end
@test x_min21 ≈ sol_exacte_fct2 atol=tol_erreur
@test flag21 == 0
@test nb_iters21 == 31
# cas de test 4
x_min22, fmin22, flag22, nb_iters22 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x022,options2)
@@ -106,6 +123,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"gct","fonction 2","x022",x_min22,fmin22, flag22,sol_exacte_fct2,nb_iters22)
end
@test x_min22 ≈ sol_exacte_fct2 atol=tol_erreur
@test flag22 == 0
@test nb_iters22 == 44
# cas de test 5
x_min23, fmin23, flag23, nb_iters23 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x023,options2)
@@ -113,6 +132,8 @@ function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Functi
afficher_resultats("régions de confiance avec "*"gct","fonction 2","x023",x_min11,fmin23, flag23,sol_exacte_fct2,nb_iters23)
end
@test x_min23 ≈ sol_exacte_fct2 atol=tol_erreur
@test flag23 == 0
@test nb_iters23 == 19
end =#
end
end
Loading