Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit bbf586a

Browse files
author
Avik Pal
committed
Dont use anything
1 parent ed0b7e5 commit bbf586a

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1313
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
16-
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1716
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1817
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1918
VertexSafeGraphs = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
@@ -27,7 +26,6 @@ FiniteDiff = "2.8.1"
2726
ForwardDiff = "0.10"
2827
LightGraphs = "1.3"
2928
Requires = "0.5, 1.0"
30-
SciMLBase = "1"
3129
StaticArrays = "1"
3230
VertexSafeGraphs = "0.1"
3331
julia = "1.6"

src/SparseDiffTools.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module SparseDiffTools
22

33
using Compat
4-
using SciMLBase
54
using FiniteDiff
65
using ForwardDiff
76
using LightGraphs

src/differentiation/vecjac_products.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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

212
function 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

0 commit comments

Comments
 (0)