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
-
23
1
function num_vecjac! (
24
2
du,
25
3
f,
@@ -29,10 +7,6 @@ function num_vecjac!(
29
7
cache2 = similar (v);
30
8
compute_f0 = true ,
31
9
)
32
- if _numargs (f) != 2
33
- du .= num_jacvec (f, x, v)
34
- return du
35
- end
36
10
compute_f0 && (f (cache1, x))
37
11
T = eltype (x)
38
12
# Should it be min? max? mean?
You can’t perform that action at this time.
0 commit comments