This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +0
-26
lines changed
Expand file tree Collapse file tree 1 file changed +0
-26
lines changed 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
11-
12-
13- # Get the number of parameters of a Tuple type, i.e. the number of fields.
14-
15- function num_types_in_tuple (sig)
16- length (sig. parameters)
17- end
18-
19- function num_types_in_tuple (sig:: UnionAll )
20- length (Base. unwrap_unionall (sig). parameters)
21- end
22-
231function num_vecjac! (
242 du,
253 f,
@@ -29,10 +7,6 @@ function num_vecjac!(
297 cache2 = similar (v);
308 compute_f0 = true ,
319)
32- if _numargs (f) != 2
33- du .= num_jacvec (f, x, v)
34- return du
35- end
3610 compute_f0 && (f (cache1, x))
3711 T = eltype (x)
3812 # Should it be min? max? mean?
You can’t perform that action at this time.
0 commit comments