Merge branch 'module-test' into 'master'

ajout des tests unitaire  dans optinum

See merge request toc/mathn7/optimisation-numerique/optinum!1
This commit is contained in:
gergaud 2021-11-24 09:27:20 +00:00
commit ac5a9fd6c5
14 changed files with 806 additions and 552 deletions

View file

@ -1,375 +0,0 @@
# This file is machine-generated - editing it directly is not advised
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[Bzip2_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "3663bfffede2ef41358b6fc2e1d8a6d50b3c3904"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.6+2"
[[ColorSchemes]]
deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"]
git-tree-sha1 = "7a15e3690529fd1042f0ab954dff7445b1efc8a5"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.9.0"
[[ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "27eb374570946a02aa184ef5b403dabaa7380693"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.10.4"
[[Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"]
git-tree-sha1 = "1e9bba7984e78aa8cdeea7f9f7cc984ad4e4b1c7"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.2"
[[Contour]]
deps = ["StaticArrays"]
git-tree-sha1 = "0b17db36e7e03f8437e0d1f55aea3e4a60c74353"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.3"
[[DataAPI]]
git-tree-sha1 = "176e23402d80e7743fc26c19c681bfb11246af32"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.3.0"
[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "be680f1ad03c0a03796aa3fda5a2180df7f83b46"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.18"
[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "c5714d9bcdba66389612dc4c47ed827c64112997"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.2"
[[Documenter]]
deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
git-tree-sha1 = "395fa1554c69735802bba37d9e7d9586fd44326c"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.24.11"
[[FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "c82bef6fc01e30d500f588cd01d29bdd44f1924e"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.3.0"
[[FFMPEG_jll]]
deps = ["Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "0fa07f43e5609ea54848b82b4bb330b250e9645b"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.1.0+3"
[[FixedPointNumbers]]
git-tree-sha1 = "8fb797c37a3b7ced4327a05ac4ca0dd6a4f1ba92"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.1"
[[FreeType2_jll]]
deps = ["Bzip2_jll", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "7d900f32a3788d4eacac2bfa3bf5c770179c8afd"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.10.1+2"
[[FriBidi_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "2f56bee16bd0151de7b6a1eeea2ced190a2ad8d4"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.5+3"
[[GR]]
deps = ["Base64", "DelimitedFiles", "HTTP", "JSON", "LinearAlgebra", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"]
git-tree-sha1 = "247adbd2b33c0c4b42efa20d1e807acf6312145f"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.50.1"
[[GeometryTypes]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "StaticArrays"]
git-tree-sha1 = "34bfa994967e893ab2f17b864eec221b3521ba4d"
uuid = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
version = "0.8.3"
[[HTTP]]
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
git-tree-sha1 = "ec87d5e2acbe1693789efbbe14f5ea7525758f71"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.8.15"
[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"
[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.0"
[[LAME_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "221cc8998b9060677448cbb6375f00032554c4fd"
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
version = "3.100.0+1"
[[LibGit2]]
deps = ["Printf"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[LibVPX_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "e3549ca9bf35feb9d9d954f4c6a9032e92f46e7c"
uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a"
version = "1.8.1+1"
[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS]]
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
git-tree-sha1 = "426a6978b03a97ceb7ead77775a1da066343ec6e"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "1.0.2"
[[MbedTLS_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "c83f5a1d038f034ad0549f9ee4d5fac3fb429e33"
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.16.0+2"
[[Measures]]
git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.1"
[[Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "de0a5ce9e5289f27df672ffabef4d1e5861247d5"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.4.3"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[NaNMath]]
git-tree-sha1 = "928b8ca9b2791081dc71a51c55347c27c618760f"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.3"
[[Ogg_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "59cf7a95bf5ac39feac80b796e0f39f9d69dc887"
uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051"
version = "1.3.4+0"
[[OpenSSL_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "d2a6f25262d568b5a7e454cf7ff5066a79d16c7d"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "1.1.1+2"
[[Opus_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "002c18f222a542907e16c83c64a1338992da7e2c"
uuid = "91d4177d-7536-5919-b921-800302f37372"
version = "1.3.1+1"
[[OrderedCollections]]
git-tree-sha1 = "12ce190210d278e12644bcadf5b21cbdcf225cd3"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.2.0"
[[Parsers]]
deps = ["Dates", "Test"]
git-tree-sha1 = "eb3e09940c0d7ae01b01d9291ebad7b081c844d3"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.0.5"
[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[PlotThemes]]
deps = ["PlotUtils", "Requires", "Statistics"]
git-tree-sha1 = "c6f5ea535551b3b16835134697f0c65d06c94b91"
uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
version = "2.0.0"
[[PlotUtils]]
deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"]
git-tree-sha1 = "e18e0e51ff07bf92bb7e06dcb9c082a4e125e20c"
uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043"
version = "1.0.5"
[[Plots]]
deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryTypes", "JSON", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"]
git-tree-sha1 = "70908194bb636437f181683625925505fd1664a8"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
version = "1.4.1"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[RecipesBase]]
git-tree-sha1 = "54f8ceb165a0f6d083f0d12cb4996f5367c6edbc"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "1.0.1"
[[RecipesPipeline]]
deps = ["Dates", "PlotUtils", "RecipesBase"]
git-tree-sha1 = "9477d23b9ded11153622d8619d0c20c4626a4ac8"
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
version = "0.1.10"
[[Reexport]]
deps = ["Pkg"]
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "0.2.0"
[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "d37400976e98018ee840e0ca4f9d20baa231dc6b"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.0.1"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[Showoff]]
deps = ["Dates"]
git-tree-sha1 = "e032c9df551fb23c9f98ae1064de074111b7bc39"
uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
version = "0.3.1"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[SortingAlgorithms]]
deps = ["DataStructures", "Random", "Test"]
git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "0.3.1"
[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "5c06c0aeb81bef54aed4b3f446847905eb6cbda0"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.12.3"
[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
git-tree-sha1 = "a6102b1f364befdb05746f386b67c6b7e3262c45"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.33.0"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[TestOptinum]]
deps = ["Markdown", "Test"]
git-tree-sha1 = "0f55172039cb2a8d64c8e001a040a7b53209ac67"
repo-rev = "master"
repo-url = "https://github.com/mathn7/TestOptinum"
uuid = "a6016688-b6f6-4950-8384-ab0954b6af15"
version = "0.1.0"
[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[Zlib_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "a2e0d558f6031002e380a90613b199e37a8565bf"
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.11+10"
[[libass_jll]]
deps = ["Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "027a304b2a90de84f690949a21f94e5ae0f92c73"
uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0"
version = "0.14.0+2"
[[libfdk_aac_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "480c7ed04f68ea3edd4c757f5db5b6a0a4e0bd99"
uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280"
version = "0.1.6+2"
[[libvorbis_jll]]
deps = ["Libdl", "Ogg_jll", "Pkg"]
git-tree-sha1 = "6a66f65b5275dfa799036c8a3a26616a0a271c4a"
uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a"
version = "1.3.6+4"
[[x264_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "d89346fe63a6465a9f44e958ac0e3d366af90b74"
uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a"
version = "2019.5.25+2"
[[x265_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "61324ad346b00a6e541896b94201c9426591e43a"
uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76"
version = "3.0.0+1"

View file

@ -1,13 +0,0 @@
name = "Optinum"
uuid = "289cfbba-6966-46b0-8dde-953cd55d6e8f"
authors = ["relmo <rachid.elmontassir@etu.enseeiht.fr>"]
version = "0.1.0"
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestOptinum = "a6016688-b6f6-4950-8384-ab0954b6af15"

View file

@ -1,7 +1,7 @@
# Optinum - Méthodes numériques pour les problèmes doptimisation
## Rendu
Le projet est à rendre sous Moodle *le vendredi 17 décembre à 18h00*. Vous rendrez un fichier compressé `nom du binome .tgz` qui déarchivez contiendra un répertoire `votre nom` qui lui-même contiendra vos répertoire Optinum et TestOptinum. Votre notebook doit se trouver dans le sous répertoire `Optinum/src`.
Le projet est à rendre sous Moodle *le vendredi 17 décembre à 18h00*. Vous rendrez un fichier compressé `votre nom.tgz` qui déarchivez contiendra un répertoire `votre nom` qui lui-même contiendra vos répertoire Optinum et TestOptinum. Votre notebook doit se trouver dans le sous répertoire `Optinum/src`.
## Instalation de julia et jupyter notebook sur vos machines

View file

@ -17,9 +17,179 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]\n",
"└ @ Base loading.jl:1342\n",
"\u001b[91m\u001b[1mERROR: \u001b[22m\u001b[39mLoadError: ArgumentError: Package DataStructures does not have Compat in its dependencies:\n",
"- If you have DataStructures checked out for development and have\n",
" added Compat as a dependency but haven't updated your primary\n",
" environment's manifest file, try `Pkg.resolve()`.\n",
"- Otherwise you may need to report an issue with DataStructures\n",
"Stacktrace:\n",
" [1] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90minto\u001b[39m::\u001b[0mModule, \u001b[90mmod\u001b[39m::\u001b[0mSymbol\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:906\u001b[0m\n",
" [2] \u001b[0m\u001b[1minclude\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mBase.jl:386\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [3] \u001b[0m\u001b[1minclude_package_for_output\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90minput\u001b[39m::\u001b[0mString, \u001b[90mdepot_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mdl_load_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mload_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mconcrete_deps\u001b[39m::\u001b[0mVector\u001b[90m{Pair{Base.PkgId, UInt64}}\u001b[39m, \u001b[90msource\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1235\u001b[0m\n",
" [4] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
" [5] \u001b[0m\u001b[1meval\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mboot.jl:360\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [6] \u001b[0m\u001b[1meval\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mx\u001b[39m::\u001b[0mExpr\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase.MainInclude\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mclient.jl:446\u001b[0m\n",
" [7] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
"in expression starting at /Users/gergaud/.julia/packages/DataStructures/nBjdy/src/DataStructures.jl:1\n",
"\u001b[91m\u001b[1mERROR: \u001b[22m\u001b[39mLoadError: Failed to precompile DataStructures [864edb3b-99cc-5e75-8d2d-829cb0a9cfe8] to /Users/gergaud/.julia/compiled/v1.6/DataStructures/jl_FUK9uh.\n",
"Stacktrace:\n",
" [1] \u001b[0m\u001b[1merror\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90ms\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4merror.jl:33\u001b[0m\n",
" [2] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString, \u001b[90minternal_stderr\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90minternal_stdout\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90mignore_loaded_modules\u001b[39m::\u001b[0mBool\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1385\u001b[0m\n",
" [3] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1329\u001b[0m\n",
" [4] \u001b[0m\u001b[1m_require\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1043\u001b[0m\n",
" [5] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90muuidkey\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:936\u001b[0m\n",
" [6] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90minto\u001b[39m::\u001b[0mModule, \u001b[90mmod\u001b[39m::\u001b[0mSymbol\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:923\u001b[0m\n",
" [7] \u001b[0m\u001b[1minclude\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mBase.jl:386\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [8] \u001b[0m\u001b[1minclude_package_for_output\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90minput\u001b[39m::\u001b[0mString, \u001b[90mdepot_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mdl_load_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mload_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mconcrete_deps\u001b[39m::\u001b[0mVector\u001b[90m{Pair{Base.PkgId, UInt64}}\u001b[39m, \u001b[90msource\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1235\u001b[0m\n",
" [9] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
" [10] \u001b[0m\u001b[1meval\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mboot.jl:360\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [11] \u001b[0m\u001b[1meval\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mx\u001b[39m::\u001b[0mExpr\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase.MainInclude\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mclient.jl:446\u001b[0m\n",
" [12] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
"in expression starting at /Users/gergaud/.julia/packages/StatsBase/Q76Ni/src/StatsBase.jl:1\n",
"\u001b[91m\u001b[1mERROR: \u001b[22m\u001b[39mLoadError: Failed to precompile StatsBase [2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91] to /Users/gergaud/.julia/compiled/v1.6/StatsBase/jl_aTmMTx.\n",
"Stacktrace:\n",
" [1] \u001b[0m\u001b[1merror\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90ms\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4merror.jl:33\u001b[0m\n",
" [2] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString, \u001b[90minternal_stderr\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90minternal_stdout\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90mignore_loaded_modules\u001b[39m::\u001b[0mBool\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1385\u001b[0m\n",
" [3] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1329\u001b[0m\n",
" [4] \u001b[0m\u001b[1m_require\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1043\u001b[0m\n",
" [5] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90muuidkey\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:936\u001b[0m\n",
" [6] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90minto\u001b[39m::\u001b[0mModule, \u001b[90mmod\u001b[39m::\u001b[0mSymbol\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:923\u001b[0m\n",
" [7] \u001b[0m\u001b[1minclude\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mBase.jl:386\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [8] \u001b[0m\u001b[1minclude_package_for_output\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90minput\u001b[39m::\u001b[0mString, \u001b[90mdepot_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mdl_load_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mload_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mconcrete_deps\u001b[39m::\u001b[0mVector\u001b[90m{Pair{Base.PkgId, UInt64}}\u001b[39m, \u001b[90msource\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1235\u001b[0m\n",
" [9] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
" [10] \u001b[0m\u001b[1meval\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mboot.jl:360\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [11] \u001b[0m\u001b[1meval\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mx\u001b[39m::\u001b[0mExpr\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase.MainInclude\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mclient.jl:446\u001b[0m\n",
" [12] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
"in expression starting at /Users/gergaud/.julia/packages/Distributions/1cqVu/src/Distributions.jl:1\n",
"\u001b[91m\u001b[1mERROR: \u001b[22m\u001b[39mLoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] to /Users/gergaud/.julia/compiled/v1.6/Distributions/jl_tmg8Kh.\n",
"Stacktrace:\n",
" [1] \u001b[0m\u001b[1merror\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90ms\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4merror.jl:33\u001b[0m\n",
" [2] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString, \u001b[90minternal_stderr\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90minternal_stdout\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90mignore_loaded_modules\u001b[39m::\u001b[0mBool\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1385\u001b[0m\n",
" [3] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1329\u001b[0m\n",
" [4] \u001b[0m\u001b[1m_require\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1043\u001b[0m\n",
" [5] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90muuidkey\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:936\u001b[0m\n",
" [6] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90minto\u001b[39m::\u001b[0mModule, \u001b[90mmod\u001b[39m::\u001b[0mSymbol\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:923\u001b[0m\n",
" [7] \u001b[0m\u001b[1minclude\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mBase.jl:386\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [8] \u001b[0m\u001b[1minclude_package_for_output\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90minput\u001b[39m::\u001b[0mString, \u001b[90mdepot_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mdl_load_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mload_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mconcrete_deps\u001b[39m::\u001b[0mVector\u001b[90m{Pair{Base.PkgId, UInt64}}\u001b[39m, \u001b[90msource\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1235\u001b[0m\n",
" [9] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
" [10] \u001b[0m\u001b[1meval\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mboot.jl:360\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [11] \u001b[0m\u001b[1meval\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mx\u001b[39m::\u001b[0mExpr\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase.MainInclude\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mclient.jl:446\u001b[0m\n",
" [12] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
"in expression starting at /Users/gergaud/.julia/packages/DiffEqBase/b1nST/src/DiffEqBase.jl:1\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[91m\u001b[1mERROR: \u001b[22m\u001b[39mLoadError: Failed to precompile DiffEqBase [2b5f629d-d688-5b77-993f-72d75c75574e] to /Users/gergaud/.julia/compiled/v1.6/DiffEqBase/jl_L6uKwc.\n",
"Stacktrace:\n",
" [1] \u001b[0m\u001b[1merror\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90ms\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4merror.jl:33\u001b[0m\n",
" [2] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString, \u001b[90minternal_stderr\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90minternal_stdout\u001b[39m::\u001b[0mIOContext\u001b[90m{Base.PipeEndpoint}\u001b[39m, \u001b[90mignore_loaded_modules\u001b[39m::\u001b[0mBool\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1385\u001b[0m\n",
" [3] \u001b[0m\u001b[1mcompilecache\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90mpath\u001b[39m::\u001b[0mString\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1329\u001b[0m\n",
" [4] \u001b[0m\u001b[1m_require\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1043\u001b[0m\n",
" [5] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90muuidkey\u001b[39m::\u001b[0mBase.PkgId\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:936\u001b[0m\n",
" [6] \u001b[0m\u001b[1mrequire\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90minto\u001b[39m::\u001b[0mModule, \u001b[90mmod\u001b[39m::\u001b[0mSymbol\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:923\u001b[0m\n",
" [7] \u001b[0m\u001b[1minclude\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mBase.jl:386\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [8] \u001b[0m\u001b[1minclude_package_for_output\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mpkg\u001b[39m::\u001b[0mBase.PkgId, \u001b[90minput\u001b[39m::\u001b[0mString, \u001b[90mdepot_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mdl_load_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mload_path\u001b[39m::\u001b[0mVector\u001b[90m{String}\u001b[39m, \u001b[90mconcrete_deps\u001b[39m::\u001b[0mVector\u001b[90m{Pair{Base.PkgId, UInt64}}\u001b[39m, \u001b[90msource\u001b[39m::\u001b[0mNothing\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mloading.jl:1235\u001b[0m\n",
" [9] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
" [10] \u001b[0m\u001b[1meval\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90m./\u001b[39m\u001b[90;4mboot.jl:360\u001b[0m\u001b[90m [inlined]\u001b[39m\n",
" [11] \u001b[0m\u001b[1meval\u001b[22m\u001b[0m\u001b[1m(\u001b[22m\u001b[90mx\u001b[39m::\u001b[0mExpr\u001b[0m\u001b[1m)\u001b[22m\n",
"\u001b[90m @ \u001b[39m\u001b[90mBase.MainInclude\u001b[39m \u001b[90m./\u001b[39m\u001b[90;4mclient.jl:446\u001b[0m\n",
" [12] top-level scope\n",
"\u001b[90m @ \u001b[39m\u001b[90;4mnone:1\u001b[0m\n",
"in expression starting at /Users/gergaud/.julia/packages/DifferentialEquations/7WPQg/src/DifferentialEquations.jl:1\n"
]
},
{
"ename": "LoadError",
"evalue": "Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to /Users/gergaud/.julia/compiled/v1.6/DifferentialEquations/jl_g1kMjp.",
"output_type": "error",
"traceback": [
"Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to /Users/gergaud/.julia/compiled/v1.6/DifferentialEquations/jl_g1kMjp.",
"",
"Stacktrace:",
" [1] error(s::String)",
" @ Base ./error.jl:33",
" [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IJulia.IJuliaStdio{Base.PipeEndpoint}, internal_stdout::IJulia.IJuliaStdio{Base.PipeEndpoint}, ignore_loaded_modules::Bool)",
" @ Base ./loading.jl:1385",
" [3] compilecache(pkg::Base.PkgId, path::String)",
" @ Base ./loading.jl:1329",
" [4] _require(pkg::Base.PkgId)",
" @ Base ./loading.jl:1043",
" [5] require(uuidkey::Base.PkgId)",
" @ Base ./loading.jl:936",
" [6] require(into::Module, mod::Symbol)",
" @ Base ./loading.jl:923",
" [7] eval",
" @ ./boot.jl:360 [inlined]",
" [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)",
" @ Base ./loading.jl:1116"
]
}
],
"source": [
"# import Pkg; Pkg.add(\"DifferentialEquations\")\n",
"# Pkg.add(\"Plots\")\n",
@ -13888,15 +14058,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.4.1",
"display_name": "Julia 1.6.3",
"language": "julia",
"name": "julia-1.4"
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.4.1"
"version": "1.6.3"
}
},
"nbformat": 4,

View file

@ -49,11 +49,9 @@ function Algorithme_De_Newton(f::Function,gradf::Function,hessf::Function,x0,opt
Tol_abs = options[2]
Tol_rel = options[3]
end
n = length(x0)
xmin = zeros(n)
f_min = 0
xmin = x0
f_min = f(x0)
flag = 0
nb_iters = 0
return xmin,f_min,flag,nb_iters
return xmin,f_min,flag,nb_iters
end

View file

@ -26,166 +26,30 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[36m\u001b[1mProject \u001b[22m\u001b[39mOptinum v0.1.0\n",
"\u001b[32m\u001b[1mStatus\u001b[22m\u001b[39m `~/ENS/optinum/TP/Optinum/Project.toml`\n",
" \u001b[90m [e30172f5]\u001b[39m\u001b[37m Documenter v0.24.11\u001b[39m\n",
" \u001b[90m [28b8d3ca]\u001b[39m\u001b[37m GR v0.50.1\u001b[39m\n",
" \u001b[90m [91a5bcdd]\u001b[39m\u001b[37m Plots v1.4.1\u001b[39m\n",
" \u001b[90m [a6016688]\u001b[39m\u001b[37m TestOptinum v0.1.0 #master (https://github.com/mathn7/TestOptinum)\u001b[39m\n",
" \u001b[90m [37e2e46d]\u001b[39m\u001b[37m LinearAlgebra \u001b[39m\n",
" \u001b[90m [d6f4376e]\u001b[39m\u001b[37m Markdown \u001b[39m\n",
" \u001b[90m [8dfed614]\u001b[39m\u001b[37m Test \u001b[39m\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1m Updating\u001b[22m\u001b[39m registry at `~/.julia/registries/General`\n",
"┌ Warning: Some registries failed to update:\n",
"│ — `~/.julia/registries/General` — registry dirty\n",
"└ @ Pkg.Types /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:1122\n",
"\u001b[32m\u001b[1m Resolving\u001b[22m\u001b[39m package versions...\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m ArrayLayouts ────────── v0.3.4\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m DifferentialEquations ─ v6.14.0\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m SymbolicUtils ───────── v0.3.4\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m NLsolve ─────────────── v4.4.0\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m BandedMatrices ──────── v0.15.12\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m StochasticDiffEq ────── v6.23.1\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m AbstractAlgebra ─────── v0.9.2\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m LightGraphs ─────────── v1.3.3\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m CEnum ───────────────── v0.4.1\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m Distances ───────────── v0.9.0\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m DiffEqNoiseProcess ──── v4.2.0\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m ModelingToolkit ─────── v3.10.2\n",
"\u001b[32m\u001b[1m Installed\u001b[22m\u001b[39m Distributions ───────── v0.23.4\n",
"\u001b[32m\u001b[1m Updating\u001b[22m\u001b[39m `~/ENS/optinum/TP/Optinum/Project.toml`\n",
" \u001b[90m [0c46a032]\u001b[39m\u001b[92m + DifferentialEquations v6.14.0\u001b[39m\n",
"\u001b[32m\u001b[1m Updating\u001b[22m\u001b[39m `~/ENS/optinum/TP/Optinum/Manifest.toml`\n",
" \u001b[90m [c3fe647b]\u001b[39m\u001b[92m + AbstractAlgebra v0.9.2\u001b[39m\n",
" \u001b[90m [1520ce14]\u001b[39m\u001b[92m + AbstractTrees v0.3.3\u001b[39m\n",
" \u001b[90m [79e6a3ab]\u001b[39m\u001b[92m + Adapt v1.1.0\u001b[39m\n",
" \u001b[90m [ec485272]\u001b[39m\u001b[92m + ArnoldiMethod v0.0.4\u001b[39m\n",
" \u001b[90m [7d9fca2a]\u001b[39m\u001b[92m + Arpack v0.4.0\u001b[39m\n",
" \u001b[90m [68821587]\u001b[39m\u001b[92m + Arpack_jll v3.5.0+3\u001b[39m\n",
" \u001b[90m [4fba245c]\u001b[39m\u001b[92m + ArrayInterface v2.8.7\u001b[39m\n",
" \u001b[90m [4c555306]\u001b[39m\u001b[92m + ArrayLayouts v0.3.4\u001b[39m\n",
" \u001b[90m [aae01518]\u001b[39m\u001b[92m + BandedMatrices v0.15.12\u001b[39m\n",
" \u001b[90m [764a87c0]\u001b[39m\u001b[92m + BoundaryValueDiffEq v2.5.0\u001b[39m\n",
" \u001b[90m [fa961155]\u001b[39m\u001b[92m + CEnum v0.4.1\u001b[39m\n",
" \u001b[90m [a603d957]\u001b[39m\u001b[92m + CanonicalTraits v0.2.1\u001b[39m\n",
" \u001b[90m [d360d2e6]\u001b[39m\u001b[92m + ChainRulesCore v0.8.0\u001b[39m\n",
" \u001b[90m [861a8166]\u001b[39m\u001b[92m + Combinatorics v1.0.2\u001b[39m\n",
" \u001b[90m [bbf7d656]\u001b[39m\u001b[92m + CommonSubexpressions v0.2.0\u001b[39m\n",
" \u001b[90m [34da2185]\u001b[39m\u001b[92m + Compat v3.12.0\u001b[39m\n",
" \u001b[90m [e66e0078]\u001b[39m\u001b[92m + CompilerSupportLibraries_jll v0.3.3+0\u001b[39m\n",
" \u001b[90m [88cd18e8]\u001b[39m\u001b[92m + ConsoleProgressMonitor v0.1.2\u001b[39m\n",
" \u001b[90m [187b0558]\u001b[39m\u001b[92m + ConstructionBase v1.0.0\u001b[39m\n",
" \u001b[90m [adafc99b]\u001b[39m\u001b[92m + CpuId v0.2.2\u001b[39m\n",
" \u001b[90m [bcd4f6db]\u001b[39m\u001b[92m + DelayDiffEq v5.24.1\u001b[39m\n",
" \u001b[90m [2b5f629d]\u001b[39m\u001b[92m + DiffEqBase v6.38.4\u001b[39m\n",
" \u001b[90m [459566f4]\u001b[39m\u001b[92m + DiffEqCallbacks v2.13.3\u001b[39m\n",
" \u001b[90m [5a0ffddc]\u001b[39m\u001b[92m + DiffEqFinancial v2.3.0\u001b[39m\n",
" \u001b[90m [c894b116]\u001b[39m\u001b[92m + DiffEqJump v6.9.1\u001b[39m\n",
" \u001b[90m [77a26b50]\u001b[39m\u001b[92m + DiffEqNoiseProcess v4.2.0\u001b[39m\n",
" \u001b[90m [055956cb]\u001b[39m\u001b[92m + DiffEqPhysics v3.2.0\u001b[39m\n",
" \u001b[90m [163ba53b]\u001b[39m\u001b[92m + DiffResults v1.0.2\u001b[39m\n",
" \u001b[90m [b552c78f]\u001b[39m\u001b[92m + DiffRules v1.0.1\u001b[39m\n",
" \u001b[90m [0c46a032]\u001b[39m\u001b[92m + DifferentialEquations v6.14.0\u001b[39m\n",
" \u001b[90m [c619ae07]\u001b[39m\u001b[92m + DimensionalPlotRecipes v1.2.0\u001b[39m\n",
" \u001b[90m [b4f34e82]\u001b[39m\u001b[92m + Distances v0.9.0\u001b[39m\n",
" \u001b[90m [31c24e10]\u001b[39m\u001b[92m + Distributions v0.23.4\u001b[39m\n",
" \u001b[90m [d4d017d3]\u001b[39m\u001b[92m + ExponentialUtilities v1.6.0\u001b[39m\n",
" \u001b[90m [1a297f60]\u001b[39m\u001b[92m + FillArrays v0.8.10\u001b[39m\n",
" \u001b[90m [6a86dc24]\u001b[39m\u001b[92m + FiniteDiff v2.3.2\u001b[39m\n",
" \u001b[90m [59287772]\u001b[39m\u001b[92m + Formatting v0.4.1\u001b[39m\n",
" \u001b[90m [f6369f11]\u001b[39m\u001b[92m + ForwardDiff v0.10.10\u001b[39m\n",
" \u001b[90m [069b7b12]\u001b[39m\u001b[92m + FunctionWrappers v1.1.1\u001b[39m\n",
" \u001b[90m [6b9d7cbe]\u001b[39m\u001b[92m + GeneralizedGenerated v0.2.4\u001b[39m\n",
" \u001b[90m [01680d73]\u001b[39m\u001b[92m + GenericSVD v0.3.0\u001b[39m\n",
" \u001b[90m [d25df0c9]\u001b[39m\u001b[92m + Inflate v0.1.2\u001b[39m\n",
" \u001b[90m [42fd0dbc]\u001b[39m\u001b[92m + IterativeSolvers v0.8.4\u001b[39m\n",
" \u001b[90m [82899510]\u001b[39m\u001b[92m + IteratorInterfaceExtensions v1.0.0\u001b[39m\n",
" \u001b[90m [b14d175d]\u001b[39m\u001b[92m + JuliaVariables v0.2.0\u001b[39m\n",
" \u001b[90m [b964fa9f]\u001b[39m\u001b[92m + LaTeXStrings v1.1.0\u001b[39m\n",
" \u001b[90m [2ee39098]\u001b[39m\u001b[92m + LabelledArrays v1.2.2\u001b[39m\n",
" \u001b[90m [23fbe1c1]\u001b[39m\u001b[92m + Latexify v0.13.5\u001b[39m\n",
" \u001b[90m [1d6d02ad]\u001b[39m\u001b[92m + LeftChildRightSiblingTrees v0.1.2\u001b[39m\n",
" \u001b[90m [093fc24a]\u001b[39m\u001b[92m + LightGraphs v1.3.3\u001b[39m\n",
" \u001b[90m [d3d80556]\u001b[39m\u001b[92m + LineSearches v7.0.1\u001b[39m\n",
" \u001b[90m [e6f89c97]\u001b[39m\u001b[92m + LoggingExtras v0.4.1\u001b[39m\n",
" \u001b[90m [bdcacae8]\u001b[39m\u001b[92m + LoopVectorization v0.8.5\u001b[39m\n",
" \u001b[90m [d00139f3]\u001b[39m\u001b[92m + METIS_jll v5.1.0+4\u001b[39m\n",
" \u001b[90m [d8e11817]\u001b[39m\u001b[92m + MLStyle v0.3.1\u001b[39m\n",
" \u001b[90m [1914dd2f]\u001b[39m\u001b[92m + MacroTools v0.5.5\u001b[39m\n",
" \u001b[90m [961ee093]\u001b[39m\u001b[92m + ModelingToolkit v3.10.2\u001b[39m\n",
" \u001b[90m [46d2c3a1]\u001b[39m\u001b[92m + MuladdMacro v0.2.2\u001b[39m\n",
" \u001b[90m [f9640e96]\u001b[39m\u001b[92m + MultiScaleArrays v1.8.1\u001b[39m\n",
" \u001b[90m [d41bc354]\u001b[39m\u001b[92m + NLSolversBase v7.6.1\u001b[39m\n",
" \u001b[90m [2774e3e8]\u001b[39m\u001b[92m + NLsolve v4.4.0\u001b[39m\n",
" \u001b[90m [71a1bf82]\u001b[39m\u001b[92m + NameResolution v0.1.3\u001b[39m\n",
" \u001b[90m [6fe1bfb0]\u001b[39m\u001b[92m + OffsetArrays v1.0.4\u001b[39m\n",
" \u001b[90m [4536629a]\u001b[39m\u001b[92m + OpenBLAS_jll v0.3.9+4\u001b[39m\n",
" \u001b[90m [efe28fd5]\u001b[39m\u001b[92m + OpenSpecFun_jll v0.5.3+3\u001b[39m\n",
" \u001b[90m [1dea7af3]\u001b[39m\u001b[92m + OrdinaryDiffEq v5.41.0\u001b[39m\n",
" \u001b[90m [90014a1f]\u001b[39m\u001b[92m + PDMats v0.9.12\u001b[39m\n",
" \u001b[90m [65888b18]\u001b[39m\u001b[92m + ParameterizedFunctions v5.3.0\u001b[39m\n",
" \u001b[90m [d96e819e]\u001b[39m\u001b[92m + Parameters v0.12.1\u001b[39m\n",
" \u001b[90m [e409e4f3]\u001b[39m\u001b[92m + PoissonRandom v0.4.0\u001b[39m\n",
" \u001b[90m [8162dcfd]\u001b[39m\u001b[92m + PrettyPrint v0.1.0\u001b[39m\n",
" \u001b[90m [33c8b6b6]\u001b[39m\u001b[92m + ProgressLogging v0.1.2\u001b[39m\n",
" \u001b[90m [92933f4c]\u001b[39m\u001b[92m + ProgressMeter v1.3.1\u001b[39m\n",
" \u001b[90m [1fd47b50]\u001b[39m\u001b[92m + QuadGK v2.3.1\u001b[39m\n",
" \u001b[90m [e6cf234a]\u001b[39m\u001b[92m + RandomNumbers v1.4.0\u001b[39m\n",
" \u001b[90m [731186ca]\u001b[39m\u001b[92m + RecursiveArrayTools v2.4.4\u001b[39m\n",
" \u001b[90m [f2c3362d]\u001b[39m\u001b[92m + RecursiveFactorization v0.1.2\u001b[39m\n",
" \u001b[90m [ae5879a3]\u001b[39m\u001b[92m + ResettableStacks v1.0.0\u001b[39m\n",
" \u001b[90m [79098fc4]\u001b[39m\u001b[92m + Rmath v0.6.1\u001b[39m\n",
" \u001b[90m [f50d1b31]\u001b[39m\u001b[92m + Rmath_jll v0.2.2+1\u001b[39m\n",
" \u001b[90m [f2b01f46]\u001b[39m\u001b[92m + Roots v1.0.2\u001b[39m\n",
" \u001b[90m [21efa798]\u001b[39m\u001b[92m + SIMDPirates v0.8.7\u001b[39m\n",
" \u001b[90m [476501e8]\u001b[39m\u001b[92m + SLEEFPirates v0.5.1\u001b[39m\n",
" \u001b[90m [1bc83da4]\u001b[39m\u001b[92m + SafeTestsets v0.0.1\u001b[39m\n",
" \u001b[90m [699a6c99]\u001b[39m\u001b[92m + SimpleTraits v0.9.2\u001b[39m\n",
" \u001b[90m [47a9eef4]\u001b[39m\u001b[92m + SparseDiffTools v1.8.0\u001b[39m\n",
" \u001b[90m [276daf66]\u001b[39m\u001b[92m + SpecialFunctions v0.10.3\u001b[39m\n",
" \u001b[90m [4c63d2b9]\u001b[39m\u001b[92m + StatsFuns v0.9.5\u001b[39m\n",
" \u001b[90m [9672c7b4]\u001b[39m\u001b[92m + SteadyStateDiffEq v1.5.1\u001b[39m\n",
" \u001b[90m [789caeaf]\u001b[39m\u001b[92m + StochasticDiffEq v6.23.1\u001b[39m\n",
" \u001b[90m [bea87d4a]\u001b[39m\u001b[92m + SuiteSparse_jll v5.4.0+8\u001b[39m\n",
" \u001b[90m [c3572dad]\u001b[39m\u001b[92m + Sundials v4.2.3\u001b[39m\n",
" \u001b[90m [fb77eaff]\u001b[39m\u001b[92m + Sundials_jll v5.2.0+0\u001b[39m\n",
" \u001b[90m [d1185830]\u001b[39m\u001b[92m + SymbolicUtils v0.3.4\u001b[39m\n",
" \u001b[90m [3783bdb8]\u001b[39m\u001b[92m + TableTraits v1.0.0\u001b[39m\n",
" \u001b[90m [5d786b92]\u001b[39m\u001b[92m + TerminalLoggers v0.1.1\u001b[39m\n",
" \u001b[90m [a759f4b9]\u001b[39m\u001b[92m + TimerOutputs v0.5.6\u001b[39m\n",
" \u001b[90m [a2a6695c]\u001b[39m\u001b[92m + TreeViews v0.3.0\u001b[39m\n",
" \u001b[90m [3a884ed6]\u001b[39m\u001b[92m + UnPack v1.0.1\u001b[39m\n",
" \u001b[90m [1986cc42]\u001b[39m\u001b[92m + Unitful v1.2.1\u001b[39m\n",
" \u001b[90m [3d5dd08c]\u001b[39m\u001b[92m + VectorizationBase v0.12.6\u001b[39m\n",
" \u001b[90m [19fa3120]\u001b[39m\u001b[92m + VertexSafeGraphs v0.1.2\u001b[39m\n",
" \u001b[90m [700de1a5]\u001b[39m\u001b[92m + ZygoteRules v0.2.0\u001b[39m\n",
" \u001b[90m [1a1011a3]\u001b[39m\u001b[92m + SharedArrays \u001b[39m\n",
" \u001b[90m [4607b0f0]\u001b[39m\u001b[92m + SuiteSparse \u001b[39m\n"
"\u001b[32m\u001b[1m Status\u001b[22m\u001b[39m `~/.julia/environments/v1.6/Project.toml`\n",
" \u001b[90m [336ed68f] \u001b[39mCSV v0.9.10\n",
" \u001b[90m [a93c6f00] \u001b[39mDataFrames v1.2.2\n",
" \u001b[90m [0c46a032] \u001b[39mDifferentialEquations v6.20.0\n",
" \u001b[90m [7073ff75] \u001b[39mIJulia v1.23.2\n",
" \u001b[90m [91a5bcdd] \u001b[39mPlots v1.23.6\n"
]
}
],
"source": [
"using Pkg\n",
"Pkg.status()\n",
"Pkg.add(\"DifferentialEquations\")"
"Pkg.status()"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -425,15 +289,15 @@
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.4.1",
"display_name": "Julia 1.6.3",
"language": "julia",
"name": "julia-1.4"
"name": "julia-1.6"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.4.1"
"version": "1.6.3"
}
},
"nbformat": 4,

24
test/cacher_stacktrace.jl Executable file
View file

@ -0,0 +1,24 @@
using Test
@doc doc"""
Cacher les traces d'appels des tests erronés ou échoués, pour les remettre, décommentez les lignes 11 et 16.
"""
function cacher_stacktrace()
Test.eval(quote
function record(ts::DefaultTestSet, t::Union{Fail, Error})
if myid() == 1
#printstyled(ts.description, ": ", color=:white) # afficher la description du testset
# ne pas afficher pour les tests interrompus
if !(t isa Error) || t.test_type != :test_interrupted
# print(t) # afficher le resultat et la solution attendu
if !isa(t, Error)
# Base.show_backtrace(stdout, scrub_backtrace(backtrace())) # afficher la trace d'appels
end
end
end
push!(ts.results, t)
t, isa(t, Error) || backtrace()
end
end)
end

108
test/fonctions_de_tests.jl Executable file
View file

@ -0,0 +1,108 @@
"""
Ce fichier contient toutes fonctions utilisés dans les tests des algorithmes :
- L'algorithme de Newton
- Les régions de confiance
- Le Lagrangien augmenté
"""
# Les points initiaux
# pour les problèmes sans contraintes
struct Pts_sans_contraintes
x011
x012
x021
x022
x023
end
x011 = [1; 0; 0]
x012 = [10; 3; -2.2]
x021 = [-1.2; 1]
x022 = [10; 0]
x023 = [0; 1/200 + 1/10^12]
# les points initiaux utilisés dans les problèmes sans contraintes
pts1 = Pts_sans_contraintes(x011,x012,x021,x022,x023)
# pour les problèmes avec contraintes
struct Pts_avec_contraintes
x01
x02
x03
x04
end
x01 = [0; 1; 1]
x02 = [0.5; 1.25; 1]
x03 = [1; 0]
x04 = [sqrt(3)/2 ;sqrt(3)/2]
pts2 = Pts_avec_contraintes(x01,x02,x03,x04)
# Les solutions exactes
# sol_exacte_fct1 = -hess_fct1(x011)\grad_fct1(zero(similar(x011)))
sol_exacte_fct1 = [1;1;1]
sol_exacte_fct2 = [1;1]
"""
La première fonction de test
# Expression
fct1(x) = 2*(x[1]+x[2]+x[3]-3)^2 + (x[1]-x[2])^2 + (x[2]-x[3])^2
"""
fct1(x) = 2*(x[1]+x[2]+x[3]-3)^2 + (x[1]-x[2])^2 + (x[2]-x[3])^2
# la gradient de la fonction fct1
function grad_fct1(x)
y1 = 4*(x[1]+x[2]+x[3]-3) + 2*(x[1]-x[2])
y2 = 4*(x[1]+x[2]+x[3]-3) - 2*(x[1]-x[2]) +2*(x[2]-x[3])
y3 = 4*(x[1]+x[2]+x[3]-3) - 2*(x[2]-x[3])
return [y1;y2;y3]
end
# la hessienne de la fonction fct1
hess_fct1(x) = [6 2 4;2 8 2;4 2 6]
"""
La première fonction de test
# Expression
fct2(x)=100*(x[2]-x[1]^2)^2+(1-x[1])^2
"""
fct2(x)=100*(x[2]-x[1]^2)^2+(1-x[1])^2
# la gradient de la fonction fct2
grad_fct2(x)=[-400*x[1]*(x[2]-x[1]^2)-2*(1-x[1]) ; 200*(x[2]-x[1]^2)]
#la hessienne de la fonction fct2
hess_fct2(x)=[-400*(x[2]-3*x[1]^2)+2 -400*x[1];-400*x[1] 200]
# Pour les problèmes avec contraintes
# solutions
sol_fct1_augm = [0.5 ; 1.25 ; 0.5]
sol_fct2_augm = [0.9072339605110892; 0.82275545631455]
"""
La première contrainte
# Expression
contrainte1(x) = x[1]+x[3]-1
"""
contrainte1(x) = x[1]+x[3]-1
grad_contrainte1(x) = [1 ;0; 1]
hess_contrainte1(x) = [0 0 0;0 0 0;0 0 0]
"""
La deuxième contrainte
# Expression
contrainte2(x) = (x[1]^2) + (x[2]^2) -1.5
"""
contrainte2(x) = (x[1]^2) + (x[2]^2) -1.5
grad_contrainte2(x) = [2*x[1] ;2*x[2]]
hess_contrainte2(x) = [2 0;0 2]
# Affichage les sorties de l'algorithme des Régions de confiance
function afficher_resultats(algo,nom_fct,point_init,xmin,fxmin,flag,sol_exacte,nbiters)
println("-------------------------------------------------------------------------")
printstyled("Résultats de : "*algo*" appliqué à "*nom_fct*" au point initial "*point_init*" :\n",bold=true,color=:blue)
println(" * xsol = ",xmin)
println(" * f(xsol) = ",fxmin)
println(" * nb_iters = ",nbiters)
println(" * flag = ",flag)
println(" * sol_exacte : ", sol_exacte)
end

View file

@ -1,18 +1,34 @@
using Markdown
using Test
using LinearAlgebra
using TestOptinum
using Optinum
include("../src/Algorithme_De_Newton.jl")
include("../src/Gradient_Conjugue_Tronque.jl")
include("../src/Lagrangien_Augmente.jl")
include("../src/Pas_De_Cauchy.jl")
include("../src/Pas_De_Cauchy.jl")#
include("../src/Regions_De_Confiance.jl")
TestOptinum.cacher_stacktrace()
#include("cacher_stacktrace.jl")
#cacher_stacktrace()
affiche = false
# Tolérance pour les tests d'égalité
tol_erreur = sqrt(eps())
## ajouter les fonctions de test
include("./fonctions_de_tests.jl")
include("./tester_algo_newton.jl")
include("tester_pas_de_cauchy.jl")
#
include("tester_gct.jl")
include("tester_regions_de_confiance.jl")
include("tester_lagrangien_augmente.jl")
affiche = true
println("affiche = ",affiche)
# Tester l'ensemble des algorithmes
@testset "Test SujetOptinum" begin

108
test/tester_algo_newton.jl Executable file
View file

@ -0,0 +1,108 @@
@doc doc"""
Tester l'algorithme de Newton local
# Entrées :
* afficher : (Bool) affichage ou non des résultats de chaque test
# Les cas de test (dans l'ordre)
* fct 1 : x011,x012
* fct 2 : x021,x022
"""
function tester_algo_newton(afficher::Bool,Algorithme_De_Newton::Function)
max_iter = 100
Tol_abs = sqrt(eps())
Tol_rel = 1e-15
options = [max_iter, Tol_abs, Tol_rel]
@testset "L'algo de Newton" begin
@testset "Cas test 1 x0 = solution" begin
# point de départ x011
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct1,grad_fct1,hess_fct1,sol_exacte_fct1,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct1","x011",x_min,fx_min,flag,sol_exacte_fct1,nb_iters)
end
@testset "solution" begin
@test isapprox(x_min, sol_exacte_fct1 , atol = tol_erreur)
end
@testset "itération" begin
@test nb_iters == 0
end
end
@testset "Cas test 1 x0 = x011" begin
#point de départ x011
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct1,grad_fct1,hess_fct1,pts1.x011,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct1","x011",x_min,fx_min,flag,sol_exacte_fct1,nb_iters)
end
@testset "solution" begin
@test isapprox(x_min, sol_exacte_fct1 , atol = tol_erreur)
end
@testset "itération" begin
@test nb_iters == 1
end
end
@testset "Cas test 1 x0 = x012" begin
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct1,grad_fct1,hess_fct1,pts1.x012,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct1","x012",x_min,fx_min,flag,sol_exacte_fct1,nb_iters)
end
@testset "solution" begin
@test x_min sol_exacte_fct1 atol = tol_erreur
end
@testset "itération" begin
@test nb_iters == 1
end
end
@testset "Cas test 2 x0 = solution" begin
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct1,grad_fct1,hess_fct1,sol_exacte_fct1,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct1","x011",x_min,fx_min,flag,sol_exacte_fct1,nb_iters)
end
@testset "solution" begin
@test isapprox(x_min, sol_exacte_fct1 , atol = tol_erreur)
end
@testset "itération" begin
@test nb_iters == 0
end
end
@testset "Cas test 2 x0 = x021" begin
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct2,grad_fct2,hess_fct2,pts1.x021,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct2","x021",x_min,fx_min,flag,sol_exacte_fct2,nb_iters)
end
@testset "solution" begin
@test x_min sol_exacte_fct2 atol = tol_erreur
end
@testset "itération" begin
@test nb_iters == 6
end
end
@testset "Cas test 2 x0 = x022" begin
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct2,grad_fct2,hess_fct2,pts1.x022,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct2","x022",x_min,fx_min,flag,sol_exacte_fct2,nb_iters)
end
@testset "solution" begin
@test x_min sol_exacte_fct2 atol = tol_erreur
end
@testset "itération" begin
@test nb_iters == 5
end
end
@testset "Cas test 2 x0 = x023" begin
options[1] = 1
sol = [-4.99999958629818e9, 8.673617379884035e-19]
x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct2,grad_fct2,hess_fct2,pts1.x023,options)
if (afficher)
afficher_resultats("algorithme de Newton ","fct2","x022",x_min,fx_min,flag,sol_exacte_fct2,nb_iters)
end
@testset "solution" begin
@test x_min sol atol = tol_erreur
end
@testset "exception" begin
options[1] = 100
@test_throws SingularException x_min, fx_min, flag, nb_iters = Algorithme_De_Newton(fct2,grad_fct2,hess_fct2,pts1.x023,options)
end
end
end
end

87
test/tester_gct.jl Executable file
View file

@ -0,0 +1,87 @@
@doc doc"""
Tester l'algorithme du gradient conjugué tronqué
# Entrées :
* afficher : (Bool) affichage ou non des résultats de chaque test
# Les cas de test (dans l'ordre)
* la quadratique 1
* la quadratique 2
* la quadratique 3
* la quadratique 4
* la quadratique 5
* la quadratique 6
"""
function tester_gct(afficher::Bool,Gradient_Conjugue_Tronque::Function)
tol = 1e-7
max_iter = 100
# Tolérance utilisé dans les tests
tol_test = 1e-3
@testset "Gradient-CT" begin
# le cas de test 1
grad = [0 ; 0]
Hess = [7 0 ; 0 2]
delta = 1
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s [0.0 ; 0.0] atol = tol_test
# le cas de test 2 H definie positive
grad = [6 ; 2]
Hess = [7 0 ; 0 2]
delta = 0.5 # sol = pas de Cauchy
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s -delta*grad/norm(grad) atol = tol_test
delta = 1.2 # saturation à la 2ieme itération
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s [-0.8740776099190263, -0.8221850958502244] atol = tol_test
delta = 3 # sol = min global
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s -Hess\grad atol = tol_test
# le cas test 2 bis matrice avec 1 vp < 0 et 1 vp > 0
grad = [1,2]
Hess = [1 0 ; 0 -1]
delta = 1. # g^T H g < 0 première direction concave
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s -delta*grad/norm(grad) atol = tol_test
grad = [1,0]
delta = 0.5 # g^T H g > 0 sol pas de Cauchy
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s -delta*grad/norm(grad) atol = tol_test
grad = [2,1] # g^T H g > 0 sol à l'itération 2, saturation
delta = 6
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s [0.48997991959774634, 5.979959839195494] atol = tol_test
# le cas de test 3
#grad = [-2 ; 1]
#Hess = [-2 0 ; 0 10]
#delta = 10
#s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
#@test s ≈ [9.102342582478453; -4.140937032991381] atol = tol_test
# le cas de test 4
#grad = [0 ; 0]
#Hess = [-2 0 ; 0 10]
#delta = 1
#s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
#@test s ≈ [0.0 ; 0.0] atol = tol_test
# le cas de test 5
grad = [2 ; 3]
Hess = [4 6 ; 6 5]
delta = 3
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s [1.9059020876695578 ; -2.3167946029410595] atol = tol_test
# le cas de test 6
# Le pas de Cauchy conduit à un gradient nul en 1 itération
grad = [2 ; 0]
Hess = [4 0 ; 0 -15]
delta = 2
s = Gradient_Conjugue_Tronque(grad,Hess,[delta;max_iter;tol])
@test s [-0.5 ; 0.0] atol = tol_test
end
end

View file

@ -0,0 +1,69 @@
@doc doc"""
Tester l'algorithme du Lagrangien augmenté
# Entrées :
* affichage : (Bool) affichage ou non des résultats de chaque test
# Les cas de test (dans l'ordre)
* Newton
* fct1 : x01, x02
* fct2 : x03, x04
* gct
* fct1 : x01, x02
* fct2 : x03, x04
* Cauchy
* fct1 : x01, x02
* fct2 : x03, x04
"""
function tester_lagrangien_augmente(afficher::Bool,Lagrangien_Augmente::Function)
# initialisation des paramètres
lambda0 = 2
mu0 = 10
tho = 2
epsilon = 1e-8
tol = 1e-5
max_iters = 1000
options = [epsilon, tol, max_iters, lambda0, mu0, tho]
# La tolérance utilisée dans les tests
tol_erreur = 1e-4
# Les trois algorithmes d'optimisations sans contraintes utlisés
algos = ["newton", "gct", "cauchy"]
@testset "Lagrangien augmenté " begin
@testset "Avec $algo" for algo in algos
# le cas de test 1
xmin,fxmin,flag,nbiters = Lagrangien_Augmente(algo,fct1,contrainte1,grad_fct1,hess_fct1,grad_contrainte1,
hess_contrainte1,pts2.x01,options)
if (afficher)
afficher_resultats("Lagrangien augmenté avec "*algo,"fonction 1","x01",xmin,fxmin,flag,sol_fct1_augm,nbiters)
end
@test isapprox(xmin,sol_fct1_augm ,atol=tol_erreur)
# le cas de test 2
xmin ,fxmin,flag,nbiters = Lagrangien_Augmente(algo,fct1,contrainte1,grad_fct1,hess_fct1,grad_contrainte1,
hess_contrainte1,pts2.x02,options)
if (afficher)
afficher_resultats("Lagrangien augmenté avec "*algo,"fonction 1","x02",xmin,fxmin,flag,sol_fct1_augm,nbiters)
end
@test xmin sol_fct1_augm atol=tol_erreur
# le cas de test 3
xmin,fxmin,flag,nbiters = Lagrangien_Augmente(algo,fct2,contrainte2,grad_fct2,hess_fct2,grad_contrainte2,
hess_contrainte2,pts2.x03,options)
if (afficher)
afficher_resultats("Lagrangien augmenté avec "*algo,"fonction 2","x03",xmin,fxmin,flag,sol_fct2_augm,nbiters)
end
@test xmin sol_fct2_augm atol=tol_erreur
# le cas de test 4
xmin ,fxmin,flag,nbiters = Lagrangien_Augmente(algo,fct2,contrainte2,grad_fct2,hess_fct2,grad_contrainte2,
hess_contrainte2,pts2.x04,options)
if (afficher)
afficher_resultats("Lagrangien augmenté avec "*algo,"fonction 2","x04",xmin,fxmin,flag,sol_fct2_augm,nbiters)
end
@test xmin sol_fct2_augm atol=tol_erreur
end
end
end

80
test/tester_pas_de_cauchy.jl Executable file
View file

@ -0,0 +1,80 @@
@doc doc"""
Tester l'algorithme de pas de Cauchy
# Entrées :
* afficher : (Bool) affichage ou non des résultats de chaque test
# Les cas de test (dans l'ordre)
* quadratique 1
* quadratique 2
* quadratique 3
"""
function tester_pas_de_cauchy(afficher::Bool,Pas_De_Cauchy::Function)
tol_erreur = 1e-6
@testset "Pas de Cauchy" begin
"# Pour la quadratique 1"
@testset "g = 0" begin
g = [0; 0]
H = [7 0 ; 0 2]
delta = 1
s, e = Pas_De_Cauchy(g,H,delta)
@test (e == 0) && (isapprox(s,[0; 0],atol=tol_erreur))
end
@testset "quad 2, non saturé" begin
g = [6; 2]
H = [7 0 ; 0 2]
delta = 1
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(norm(g)^2/(g'*H*g))*g
@test (e == 1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
@testset "quad 2, saturé" begin
g = [6; 2]
H = [7 0 ; 0 2]
delta = 0.9
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(delta/norm(g))*g
@test (e == -1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
@testset "quad 3, non saturé" begin
g = [-2; 1]
H = [-2 0 ; 0 10]
delta = 6
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(norm(g)^2/(g'*H*g))*g
println("Cauchy 4 = ", sol)
@test (e == 1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
@testset "quad 3, saturé" begin
g = [-2; 1]
H = [-2 0 ; 0 10]
delta = 5
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(delta/norm(g))*g
println("Cauchy 5= ", sol)
@test (e == -1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
@testset "quad 3, g'*H*g <0 saturé" begin
g = [3; 1]
H = [-2 0 ; 0 10]
delta = 5
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(delta/norm(g))*g
println("Cauchy 6= ", sol)
@test (e == -1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
@testset "quad 3, g'*H*g = 0 saturé" begin
g = [1,2]
H = [2 -1 ; 4 -2]
delta = 5
s, e = Pas_De_Cauchy(g,H,delta)
sol = -(delta/norm(g))*g
println("Cauchy 6= ", sol)
@test (e == -1) && (isapprox(s,sol,atol=tol_erreur)) # sol = [-0.9230769230769234; -0.30769230769230776]
end
end
end

View file

@ -0,0 +1,118 @@
@doc doc"""
Tester l'algorithme des régions de confiance
# Entrées :
* affichage : (Bool) affichage ou non des résultats de chaque test
# les cas de test (dans l'ordre)
* avec Cauchy :
- fct 1 : x011,x012
- fct 2 : x021,x022,x023
* avec gct :
- fct 1 : x011,x012
- fct 2 : x021,x022,x023
"""
function tester_regions_de_confiance(afficher::Bool,Regions_De_Confiance::Function)
# La tolérance utilisée dans les tests
tol_erreur = 1e-2
# initialisation des variables de l'algorithme
gamma1 = 0.5
gamma2 = 2.00
eta1 = 0.25
eta2 = 0.75
deltaMax = 10
Tol_abs = sqrt(eps())
Tol_rel = 1e-8
maxits = 5000
delta0_1 = 2
delta0_2 = 2
options1 =[deltaMax,gamma1,gamma2,eta1,eta2,delta0_1,maxits,Tol_abs,Tol_rel]
options2 =[deltaMax,gamma1,gamma2,eta1,eta2,delta0_2,maxits,Tol_abs,Tol_rel]
# l'ensemble de tests
@testset "La méthode des RC " begin
###################################################
# les tests avec le pas de Cauchy #
###################################################
# Un premier sous-ensemble de tests
@testset "avec Cauchy " begin
# cas de test 1
x_min11, fmin11, flag11, nb_iters11 = Regions_De_Confiance("cauchy",fct1,grad_fct1,hess_fct1,pts1.x011,options1)
if (afficher)
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)
# cas de test 2
x_min12, fmin12, flag12, nb_iters12 = Regions_De_Confiance("cauchy",fct1,grad_fct1,hess_fct1,pts1.x012,options1)
if (afficher)
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
# cas de test 3
x_min21, fmin21, flag21, nb_iters21, = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x021,options2)
if (afficher)
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
# cas de test 4
x_min22, fmin22, flag22, nb_iters22 = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x022,options2)
println("iters = ", nb_iters22)
if (afficher)
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
# cas de test 5
x_min23, fmin23, flag23, nb_iters23 = Regions_De_Confiance("cauchy",fct2,grad_fct2,hess_fct2,pts1.x023,options2)
if (afficher)
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
end
###################################################
# les tests avec le gradient conjugué tronqué #
###################################################
# Un deuxième sous-ensemble de tests
@testset "avec GCT " begin
# cas de test 1
x_min11, fmin11, flag11, nb_iters11= Regions_De_Confiance("gct",fct1,grad_fct1,hess_fct1,pts1.x011,options1)
if (afficher)
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)
# cas de test 2
x_min12, fmin12, flag12, nb_iters12 = Regions_De_Confiance("gct",fct1,grad_fct1,hess_fct1,pts1.x012,options1)
if (afficher)
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
# cas de test 3
x_min21, fmin21, flag21, nb_iters21 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x021,options2)
if (afficher)
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
# cas de test 4
x_min22, fmin22, flag22, nb_iters22 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x022,options2)
if (afficher)
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
# cas de test 5
x_min23, fmin23, flag23, nb_iters23 = Regions_De_Confiance("gct",fct2,grad_fct2,hess_fct2,pts1.x023,options2)
if (afficher)
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
end
end
end