Skip to content

Commit 607e73d

Browse files
committed
fix: update quadratic solving
1 parent 8b0316d commit 607e73d

File tree

3 files changed

+62
-81
lines changed

3 files changed

+62
-81
lines changed

benchmarks/NonlinearProblem/Manifest.toml

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ version = "1.1.0"
239239

240240
[[deps.CairoMakie]]
241241
deps = ["CRC32c", "Cairo", "Cairo_jll", "Colors", "FileIO", "FreeType", "GeometryBasics", "LinearAlgebra", "Makie", "PrecompileTools"]
242-
git-tree-sha1 = "fbfdb7cbe17bd14b60646c14c27a16e5038cde54"
242+
git-tree-sha1 = "c3161fbfe99d9d7ee121cf2017d49966b152857c"
243243
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
244-
version = "0.12.15"
244+
version = "0.12.16"
245245

246246
[[deps.Cairo_jll]]
247247
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
@@ -507,12 +507,9 @@ version = "1.15.1"
507507

508508
[[deps.DifferentiationInterface]]
509509
deps = ["ADTypes", "LinearAlgebra"]
510-
git-tree-sha1 = "0174653eb226102c49a83fd34913da154463f56b"
511-
repo-rev = "gd/polybatch"
512-
repo-subdir = "DifferentiationInterface"
513-
repo-url = "https://github.com/JuliaDiff/DifferentiationInterface.jl.git"
510+
git-tree-sha1 = "ba137efeddd4b6e6a7154f2a92d2922a0057486f"
514511
uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
515-
version = "0.6.19"
512+
version = "0.6.21"
516513

517514
[deps.DifferentiationInterface.extensions]
518515
DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore"
@@ -567,9 +564,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
567564

568565
[[deps.Distributions]]
569566
deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"]
570-
git-tree-sha1 = "d7477ecdafb813ddee2ae727afa94e9dcb5f3fb0"
567+
git-tree-sha1 = "3101c32aab536e7a27b1763c0797dba151b899ad"
571568
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
572-
version = "0.25.112"
569+
version = "0.25.113"
573570

574571
[deps.Distributions.extensions]
575572
DistributionsChainRulesCoreExt = "ChainRulesCore"
@@ -633,9 +630,9 @@ version = "1.0.4"
633630

634631
[[deps.Enzyme]]
635632
deps = ["CEnum", "EnzymeCore", "Enzyme_jll", "GPUCompiler", "LLVM", "Libdl", "LinearAlgebra", "ObjectFile", "Preferences", "Printf", "Random", "SparseArrays"]
636-
git-tree-sha1 = "abcbb722aafe8ed9cc667884b3a1e1d259c5e562"
633+
git-tree-sha1 = "136f590cfed1c25b956fedc6a4d77342e3d4eaa3"
637634
uuid = "7da242da-08ed-463a-9acd-ee780be4f1d9"
638-
version = "0.13.13"
635+
version = "0.13.14"
639636

640637
[deps.Enzyme.extensions]
641638
EnzymeBFloat16sExt = "BFloat16s"
@@ -662,9 +659,9 @@ weakdeps = ["Adapt"]
662659

663660
[[deps.Enzyme_jll]]
664661
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
665-
git-tree-sha1 = "62cf2140d8daa3181e9f9d7a8b5e7b9493a57f21"
662+
git-tree-sha1 = "dec17951c0ba91ef723dc71c7687e60398125226"
666663
uuid = "7cc45869-7501-5eee-bdea-0790c847d4ef"
667-
version = "0.0.159+0"
664+
version = "0.0.163+0"
668665

669666
[[deps.ExactPredicates]]
670667
deps = ["IntervalArithmetic", "Random", "StaticArrays"]
@@ -882,9 +879,9 @@ version = "0.4.2"
882879

883880
[[deps.GeoInterface]]
884881
deps = ["Extents", "GeoFormatTypes"]
885-
git-tree-sha1 = "2f6fce56cdb8373637a6614e14a5768a88450de2"
882+
git-tree-sha1 = "826b4fd69438d9ce4d2b19de6bc2f970f45f0f88"
886883
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
887-
version = "1.3.7"
884+
version = "1.3.8"
888885

889886
[[deps.GeometryBasics]]
890887
deps = ["EarCut_jll", "Extents", "GeoInterface", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
@@ -924,9 +921,9 @@ version = "2.80.5+0"
924921

925922
[[deps.Graphics]]
926923
deps = ["Colors", "LinearAlgebra", "NaNMath"]
927-
git-tree-sha1 = "d61890399bc535850c4bf08e4e0d3a7ad0f21cbd"
924+
git-tree-sha1 = "a641238db938fff9b2f60d08ed9030387daf428c"
928925
uuid = "a2bd30eb-e257-5431-a919-1863eab51364"
929-
version = "1.1.2"
926+
version = "1.1.3"
930927

931928
[[deps.Graphite2_jll]]
932929
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -989,9 +986,9 @@ version = "0.1.17"
989986

990987
[[deps.Hwloc_jll]]
991988
deps = ["Artifacts", "JLLWrappers", "Libdl"]
992-
git-tree-sha1 = "dd3b49277ec2bb2c6b94eb1604d4d0616016f7a6"
989+
git-tree-sha1 = "50aedf345a709ab75872f80a2779568dc0bb461b"
993990
uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8"
994-
version = "2.11.2+0"
991+
version = "2.11.2+1"
995992

996993
[[deps.HypergeometricFunctions]]
997994
deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"]
@@ -1001,9 +998,9 @@ version = "0.3.24"
1001998

1002999
[[deps.IJulia]]
10031000
deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Libdl", "Logging", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "Test", "UUIDs", "ZMQ"]
1004-
git-tree-sha1 = "1702f79fa30f56b68d5b2fd6fb3a9a14ff6f9130"
1001+
git-tree-sha1 = "1b1299f7d6617291f3d260e9f5b0250afdaac8c0"
10051002
uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
1006-
version = "1.25.0"
1003+
version = "1.26.0"
10071004

10081005
[[deps.IOCapture]]
10091006
deps = ["Logging", "Random"]
@@ -1018,9 +1015,9 @@ version = "0.1.1"
10181015

10191016
[[deps.ImageAxes]]
10201017
deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"]
1021-
git-tree-sha1 = "2e4520d67b0cef90865b3ef727594d2a58e0e1f8"
1018+
git-tree-sha1 = "e12629406c6c4442539436581041d372d69c55ba"
10221019
uuid = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac"
1023-
version = "0.6.11"
1020+
version = "0.6.12"
10241021

10251022
[[deps.ImageBase]]
10261023
deps = ["ImageCore", "Reexport"]
@@ -1030,9 +1027,9 @@ version = "0.1.7"
10301027

10311028
[[deps.ImageCore]]
10321029
deps = ["ColorVectorSpace", "Colors", "FixedPointNumbers", "MappedArrays", "MosaicViews", "OffsetArrays", "PaddedViews", "PrecompileTools", "Reexport"]
1033-
git-tree-sha1 = "b2a7eaa169c13f5bcae8131a83bc30eff8f71be0"
1030+
git-tree-sha1 = "b219503865f42a12ad20ea67082e0fdb69b73ad9"
10341031
uuid = "a09fc81d-aa75-5fe9-8630-4744c3626534"
1035-
version = "0.10.2"
1032+
version = "0.10.3"
10361033

10371034
[[deps.ImageIO]]
10381035
deps = ["FileIO", "IndirectArrays", "JpegTurbo", "LazyModules", "Netpbm", "OpenEXR", "PNGFiles", "QOI", "Sixel", "TiffImages", "UUIDs", "WebP"]
@@ -1042,9 +1039,9 @@ version = "0.6.9"
10421039

10431040
[[deps.ImageMetadata]]
10441041
deps = ["AxisArrays", "ImageAxes", "ImageBase", "ImageCore"]
1045-
git-tree-sha1 = "355e2b974f2e3212a75dfb60519de21361ad3cb7"
1042+
git-tree-sha1 = "2a81c3897be6fbcde0802a0ebe6796d0562f63ec"
10461043
uuid = "bc367c6b-8a6b-528e-b4bd-a4b897500b49"
1047-
version = "0.9.9"
1044+
version = "0.9.10"
10481045

10491046
[[deps.Imath_jll]]
10501047
deps = ["Artifacts", "JLLWrappers", "Libdl"]
@@ -1095,9 +1092,9 @@ weakdeps = ["Unitful"]
10951092

10961093
[[deps.IntervalArithmetic]]
10971094
deps = ["CRlibm_jll", "LinearAlgebra", "MacroTools", "RoundingEmulator"]
1098-
git-tree-sha1 = "c59c57c36683aa17c563be6edaac888163f35285"
1095+
git-tree-sha1 = "24c095b1ec7ee58b936985d31d5df92f9b9cfebb"
10991096
uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
1100-
version = "0.22.18"
1097+
version = "0.22.19"
11011098
weakdeps = ["DiffRules", "ForwardDiff", "IntervalSets", "RecipesBase"]
11021099

11031100
[deps.IntervalArithmetic.extensions]
@@ -1515,15 +1512,15 @@ version = "0.5.13"
15151512

15161513
[[deps.Makie]]
15171514
deps = ["Animations", "Base64", "CRC32c", "ColorBrewer", "ColorSchemes", "ColorTypes", "Colors", "Contour", "Dates", "DelaunayTriangulation", "Distributions", "DocStringExtensions", "Downloads", "FFMPEG_jll", "FileIO", "FilePaths", "FixedPointNumbers", "Format", "FreeType", "FreeTypeAbstraction", "GeometryBasics", "GridLayoutBase", "ImageBase", "ImageIO", "InteractiveUtils", "Interpolations", "IntervalSets", "InverseFunctions", "Isoband", "KernelDensity", "LaTeXStrings", "LinearAlgebra", "MacroTools", "MakieCore", "Markdown", "MathTeXEngine", "Observables", "OffsetArrays", "Packing", "PlotUtils", "PolygonOps", "PrecompileTools", "Printf", "REPL", "Random", "RelocatableFolders", "Scratch", "ShaderAbstractions", "Showoff", "SignedDistanceFields", "SparseArrays", "Statistics", "StatsBase", "StatsFuns", "StructArrays", "TriplotBase", "UnicodeFun", "Unitful"]
1518-
git-tree-sha1 = "f7907907eb914138cc9e9ee66ab46f7a9efac8e8"
1515+
git-tree-sha1 = "5e4e0e027642293da251bf35dac408d692ccba8b"
15191516
uuid = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
1520-
version = "0.21.15"
1517+
version = "0.21.16"
15211518

15221519
[[deps.MakieCore]]
15231520
deps = ["ColorTypes", "GeometryBasics", "IntervalSets", "Observables"]
1524-
git-tree-sha1 = "4604f03e5b057e8e62a95a44929cafc9585b0fe9"
1521+
git-tree-sha1 = "ae4dbe0fcf1594ed98594e5f4ee685295a2a6f74"
15251522
uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
1526-
version = "0.8.9"
1523+
version = "0.8.10"
15271524

15281525
[[deps.ManualMemory]]
15291526
git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd"
@@ -1656,9 +1653,9 @@ version = "0.1.2"
16561653

16571654
[[deps.NonlinearSolve]]
16581655
deps = ["ADTypes", "ArrayInterface", "BracketingNonlinearSolve", "CommonSolve", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LineSearch", "LinearAlgebra", "LinearSolve", "NonlinearSolveBase", "NonlinearSolveFirstOrder", "NonlinearSolveQuasiNewton", "NonlinearSolveSpectralMethods", "PrecompileTools", "Preferences", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseMatrixColorings", "StaticArraysCore", "SymbolicIndexingInterface"]
1659-
git-tree-sha1 = "9f439228010f9fb284e799c76ecd1435e3d53cf2"
1656+
git-tree-sha1 = "22f3efdd47bd18d8a26bd559fff254e6b21000fd"
16601657
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1661-
version = "4.0.0"
1658+
version = "4.1.0"
16621659

16631660
[deps.NonlinearSolve.extensions]
16641661
NonlinearSolveFastLevenbergMarquardtExt = "FastLevenbergMarquardt"
@@ -1688,9 +1685,9 @@ version = "4.0.0"
16881685

16891686
[[deps.NonlinearSolveBase]]
16901687
deps = ["ADTypes", "Adapt", "ArrayInterface", "CommonSolve", "Compat", "ConcreteStructs", "DifferentiationInterface", "EnzymeCore", "FastClosures", "FunctionProperties", "LinearAlgebra", "Markdown", "MaybeInplace", "Preferences", "Printf", "RecursiveArrayTools", "SciMLBase", "SciMLJacobianOperators", "SciMLOperators", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"]
1691-
git-tree-sha1 = "8af62eea590874a2586f0eb96496dcb88bd0d091"
1688+
git-tree-sha1 = "1589ef8aac99a21d132adf1ec5cbe6ef651760ff"
16921689
uuid = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
1693-
version = "1.2.0"
1690+
version = "1.3.1"
16941691

16951692
[deps.NonlinearSolveBase.extensions]
16961693
NonlinearSolveBaseBandedMatricesExt = "BandedMatrices"
@@ -1767,9 +1764,9 @@ version = "0.3.23+4"
17671764

17681765
[[deps.OpenEXR]]
17691766
deps = ["Colors", "FileIO", "OpenEXR_jll"]
1770-
git-tree-sha1 = "327f53360fdb54df7ecd01e96ef1983536d1e633"
1767+
git-tree-sha1 = "97db9e07fe2091882c765380ef58ec553074e9c7"
17711768
uuid = "52e1d378-f018-4a11-a4be-720524705ac7"
1772-
version = "0.3.2"
1769+
version = "0.3.3"
17731770

17741771
[[deps.OpenEXR_jll]]
17751772
deps = ["Artifacts", "Imath_jll", "JLLWrappers", "Libdl", "Zlib_jll"]
@@ -2015,9 +2012,9 @@ version = "1.2.1"
20152012

20162013
[[deps.QOI]]
20172014
deps = ["ColorTypes", "FileIO", "FixedPointNumbers"]
2018-
git-tree-sha1 = "18e8f4d1426e965c7b532ddd260599e1510d26ce"
2015+
git-tree-sha1 = "8b3fc30bc0390abdce15f8822c889f669baed73d"
20192016
uuid = "4b34888f-f399-49d4-9bb3-47ed5cae4e65"
2020-
version = "1.0.0"
2017+
version = "1.0.1"
20212018

20222019
[[deps.QuadGK]]
20232020
deps = ["DataStructures", "LinearAlgebra"]
@@ -2201,9 +2198,9 @@ version = "0.2.0"
22012198

22022199
[[deps.SciMLBase]]
22032200
deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"]
2204-
git-tree-sha1 = "7a54136472ca0cb0f66ef22aa3f0ff198f379fa7"
2201+
git-tree-sha1 = "f102316e5c958b425ef530ee51c7c8a1def55d1f"
22052202
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
2206-
version = "2.58.0"
2203+
version = "2.58.1"
22072204

22082205
[deps.SciMLBase.extensions]
22092206
SciMLBaseChainRulesCoreExt = "ChainRulesCore"
@@ -2575,9 +2572,9 @@ version = "3.7.2"
25752572

25762573
[[deps.Symbolics]]
25772574
deps = ["ADTypes", "ArrayInterface", "Bijections", "CommonWorldInvalidations", "ConstructionBase", "DataStructures", "DiffRules", "Distributions", "DocStringExtensions", "DomainSets", "DynamicPolynomials", "IfElse", "LaTeXStrings", "Latexify", "Libdl", "LinearAlgebra", "LogExpFunctions", "MacroTools", "Markdown", "NaNMath", "PrecompileTools", "Primes", "RecipesBase", "Reexport", "RuntimeGeneratedFunctions", "SciMLBase", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArraysCore", "SymbolicIndexingInterface", "SymbolicLimits", "SymbolicUtils", "TermInterface"]
2578-
git-tree-sha1 = "9a25841c36b17f116590c8863e5188890f979cc1"
2575+
git-tree-sha1 = "0caef7687abf7094132fa3112bf5514c36a99226"
25792576
uuid = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2580-
version = "6.18.1"
2577+
version = "6.18.3"
25812578

25822579
[deps.Symbolics.extensions]
25832580
SymbolicsForwardDiffExt = "ForwardDiff"
@@ -2640,9 +2637,9 @@ version = "0.5.2"
26402637

26412638
[[deps.TiffImages]]
26422639
deps = ["ColorTypes", "DataStructures", "DocStringExtensions", "FileIO", "FixedPointNumbers", "IndirectArrays", "Inflate", "Mmap", "OffsetArrays", "PkgVersion", "ProgressMeter", "SIMD", "UUIDs"]
2643-
git-tree-sha1 = "6ee0c220d0aecad18792c277ae358129cc50a475"
2640+
git-tree-sha1 = "0248b1b2210285652fbc67fd6ced9bf0394bcfec"
26442641
uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69"
2645-
version = "0.11.0"
2642+
version = "0.11.1"
26462643

26472644
[[deps.TimerOutputs]]
26482645
deps = ["ExprTools", "Printf"]
@@ -2737,9 +2734,9 @@ version = "0.10.12"
27372734

27382735
[[deps.WebP]]
27392736
deps = ["CEnum", "ColorTypes", "FileIO", "FixedPointNumbers", "ImageCore", "libwebp_jll"]
2740-
git-tree-sha1 = "f1f6d497ff84039deeb37f264396dac0c2250497"
2737+
git-tree-sha1 = "aa1ca3c47f119fbdae8770c29820e5e6119b83f2"
27412738
uuid = "e3aaa7dc-3e4b-44e0-be63-ffb868ccd7c1"
2742-
version = "0.1.2"
2739+
version = "0.1.3"
27432740

27442741
[[deps.WoodburyMatrices]]
27452742
deps = ["LinearAlgebra", "SparseArrays"]

benchmarks/NonlinearProblem/bruss.jmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ using NonlinearSolve, SparseDiffTools, LinearAlgebra, SparseArrays, DiffEqDevToo
1212
CairoMakie, Symbolics, BenchmarkTools, PolyesterForwardDiff, LinearSolve, Sundials,
1313
Enzyme, SparseConnectivityTracer, DifferentiationInterface
1414
import NLsolve, MINPACK, PETSc
15-
RUS = RadiusUpdateSchemes;
15+
16+
const RUS = RadiusUpdateSchemes;
1617
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 0.2;
1718
```
1819

benchmarks/NonlinearProblem/quadratic_nonlinear.jmd

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ This is a test of a simple small nonlinear rootfinding problem.
99
using NonlinearSolve, StaticArrays, DiffEqDevTools, Sundials, CairoMakie, LinearSolve,
1010
LinearAlgebra, StableRNGs, BenchmarkTools, Setfield
1111
import PolyesterForwardDiff, MINPACK, NLsolve, SpeedMapping
12-
RUS = RadiusUpdateSchemes;
12+
13+
const RUS = RadiusUpdateSchemes;
1314
BenchmarkTools.DEFAULT_PARAMETERS.seconds = 0.5;
1415

1516
f_oop(u, p) = u .* u .- p
@@ -18,7 +19,8 @@ f_iip(du, u, p) = @. du = u * u - p
1819
function generate_prob(::Val{N}, ::Val{static}) where {N, static}
1920
u0_ = ones(N) .+ randn(StableRNG(0), N) * 0.01
2021
u0 = static ? SVector{N, Float64}(u0_) : u0_
21-
prob = static ? NonlinearProblem{false}(f_oop, u0, 2.0) :
22+
prob = static ?
23+
NonlinearProblem{false}(f_oop, u0, 2.0) :
2224
NonlinearProblem{true}(f_iip, u0, 2.0)
2325
return prob
2426
end
@@ -207,46 +209,28 @@ save("regular_arrays_quadratic.svg", fig)
207209
## Comparison against SimpleNonlinearSolve
208210

209211
```julia
210-
function __set_ad_chunksize(solver::GeneralizedFirstOrderAlgorithm{CJ, N}, ck) where {CJ, N}
211-
ad = AutoForwardDiff(; chunksize = ck)
212-
return GeneralizedFirstOrderAlgorithm{CJ, N}(; solver.descent, solver.linesearch,
213-
solver.trustregion, jacobian_ad = ad, solver.max_shrink_times, solver.forward_ad,
214-
solver.reverse_ad)
215-
end
216-
function __set_ad_chunksize(solver::SimpleNewtonRaphson, ck)
217-
solver.autodiff === nothing || return solver
218-
autodiff = AutoForwardDiff(; chunksize = ck)
219-
return SimpleNewtonRaphson(; autodiff)
220-
end
221-
function __set_ad_chunksize(solver::SimpleTrustRegion, ck)
222-
solver.autodiff === nothing || return solver
223-
autodiff = AutoForwardDiff(; chunksize = ck)
224-
return SimpleTrustRegion(; autodiff)
225-
end
226-
__set_ad_chunksize(solver, _) = solver
227-
228212
function benchmark_combinations(solvers, probs)
229213
return map(Iterators.product(solvers, probs)) do (solver, prob)
230214
try
231-
solver_concrete = prob.u0 isa SArray ? solver.solver[:alg] :
232-
__set_ad_chunksize(solver.solver[:alg],
233-
min(NonlinearSolve.pickchunksize(prob.u0), 6))
234-
215+
solver_concrete = solver.solver[:alg]
216+
termination_condition = NonlinearSolveBase.AbsNormTerminationMode(
217+
Base.Fix1(maximum, abs))
235218
sol = solve(prob, solver_concrete; abstol = 1e-10, reltol = 1e-10,
236-
maxiters = 1000, termination_condition = AbsNormTerminationMode())
219+
maxiters = 1000, termination_condition)
237220
@info "Solver $(solver.name) successfully solved the problem with norm = \
238221
$(norm(sol.resid, Inf))."
239222

240223
if norm(sol.resid, Inf) ≤ 1e-10
241224
tt = @belapsed solve($prob, $solver_concrete; abstol = 1e-10,
242-
reltol = 1e-10, maxiters = 1000)
225+
reltol = 1e-10, maxiters = 1000,
226+
termination_condition = $termination_condition)
243227
@info "Solver $(solver.name) took $(tt) seconds."
244228
return tt
245229
else
246230
return NaN
247231
end
248232
catch e
249-
@error "Solver $(solver.name) threw an error."
233+
@error "Solver $(solver.name) threw an error $(e)."
250234
return NaN
251235
end
252236
end
@@ -299,15 +283,14 @@ fig = begin
299283

300284
ax = Axis(fig[1, i];
301285
ylabel = "",
302-
title = L"N = %$(length(probs_sa[i].u0))$",
286+
title = L"$N = %$(length(probs_sa[i].u0))$",
303287
titlegap = 10, xticksvisible = false, yticksvisible = true,
304288
xticklabelsvisible = false, yticklabelsvisible = true, titlesize = 22,
305289
spinewidth = STROKEWIDTH, xlabelsize = 22, ylabelsize = 22,
306290
xticklabelrotation = π / 4, xticklabelsize = 20, yticklabelsize = 20)
307291
axs[1, i] = ax
308292

309-
barplot!(ax, xs, ys; dogde = dodge, color = dodge, colormap = :seaborn_bright,
310-
strokewidth = 2)
293+
barplot!(ax, xs, ys; color = dodge, colormap = :seaborn_bright, strokewidth = 2)
311294

312295
hlines!(ax, [1.0], color = :black, linestyle = :dash, linewidth = 2)
313296
end
@@ -324,7 +307,7 @@ fig = begin
324307

325308
ax = Axis(fig[2, i];
326309
ylabel = "",
327-
title = L"N = %$(length(probs_reg[i].u0))$",
310+
title = L"$N = %$(length(probs_reg[i].u0))$",
328311
titlegap = 10, xticksvisible = true, yticksvisible = true,
329312
xticklabelsvisible = true, yticklabelsvisible = true, titlesize = 22,
330313
spinewidth = STROKEWIDTH, xlabelsize = 22, ylabelsize = 22,

0 commit comments

Comments
 (0)