This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1313LightGraphs = " 093fc24a-ae57-5d10-9952-331d41423f4d"
1414LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515Requires = " ae029012-a4dd-5104-9daa-d747884805df"
16- SciMLBase = " 0bca4576-84f4-4d90-8ffe-ffa030f20462"
1716SparseArrays = " 2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1817StaticArrays = " 90137ffa-7385-5640-81b9-e52037218182"
1918VertexSafeGraphs = " 19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
@@ -27,7 +26,6 @@ FiniteDiff = "2.8.1"
2726ForwardDiff = " 0.10"
2827LightGraphs = " 1.3"
2928Requires = " 0.5, 1.0"
30- SciMLBase = " 1"
3129StaticArrays = " 1"
3230VertexSafeGraphs = " 0.1"
3331julia = " 1.6"
Original file line number Diff line number Diff line change 11module SparseDiffTools
22
33using Compat
4- using SciMLBase
54using FiniteDiff
65using ForwardDiff
76using LightGraphs
Original file line number Diff line number Diff line change 1+ function _numargs (f)
2+ typ = Tuple{Any, Val{:analytic }, Vararg}
3+ typ2 = Tuple{Any, Type{Val{:analytic }}, Vararg} # This one is required for overloaded types
4+ typ3 = Tuple{Any, Val{:jac }, Vararg}
5+ typ4 = Tuple{Any, Type{Val{:jac }}, Vararg} # This one is required for overloaded types
6+ typ5 = Tuple{Any, Val{:tgrad }, Vararg}
7+ typ6 = Tuple{Any, Type{Val{:tgrad }}, Vararg} # This one is required for overloaded types
8+ numparam = maximum ([(m. sig<: typ || m. sig<: typ2 || m. sig<: typ3 || m. sig<: typ4 || m. sig<: typ5 || m. sig<: typ6 ) ? 0 : num_types_in_tuple (m. sig) for m in methods (f)])
9+ return (numparam- 1 ) # -1 in v0.5 since it adds f as the first parameter
10+ end
111
212function num_vecjac! (
313 du,
@@ -8,7 +18,7 @@ function num_vecjac!(
818 cache2 = similar (v);
919 compute_f0 = true ,
1020)
11- if SciMLBase . numargs (f) != 2
21+ if _numargs (f) != 2
1222 du .= num_jacvec (f, x, v)
1323 return du
1424 end
You can’t perform that action at this time.
0 commit comments