File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,17 @@ isparameter(x) = false
10
10
11
11
Maps the variable to a paramter.
12
12
"""
13
- toparam (s:: Symbolic ) = setmetadata (s, MTKParameterCtx, true )
13
+ function toparam (s)
14
+ if s isa Symbolics. Arr
15
+ Symbolics. wrap (toparam (Symbolics. unwrap (s)))
16
+ elseif s isa AbstractArray
17
+ map (toparam, s)
18
+ elseif symtype (s) <: AbstractArray
19
+ Symbolics. recurse_and_apply (toparam, s)
20
+ else
21
+ setmetadata (s, MTKParameterCtx, true )
22
+ end
23
+ end
14
24
toparam (s:: Num ) = Num (toparam (value (s)))
15
25
16
26
"""
@@ -40,7 +50,6 @@ macro parameters(xs...)
40
50
Symbolics. _parse_vars (:parameters ,
41
51
Real,
42
52
xs,
43
- x -> x isa AbstractArray ?
44
- Symbolics. recurse_and_apply (toparam, x) : toparam (x),
53
+ toparam,
45
54
) |> esc
46
55
end
You can’t perform that action at this time.
0 commit comments