Skip to content

Commit 4735993

Browse files
fix direct tests
1 parent 209583a commit 4735993

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/direct.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ function test_worldage()
4848
eqs =*(y-x),
4949
x*-z)-y,
5050
x*y - β*z]
51-
_f = eval(ModelingToolkit.build_function(eqs,[x,y,z],[σ,ρ,β]))
52-
f(u,p) = ModelingToolkit.fast_invokelatest(_f,typeof(u),u,p)
53-
f(du,u,p) = ModelingToolkit.fast_invokelatest(_f,Nothing,du,u,p)
51+
f, f_iip = ModelingToolkit.build_function(eqs,[x,y,z],[σ,ρ,β],ModelingToolkit.simplified_expr,Val{false})
5452
out = [1.0,2,3]
5553
o1 = f([1.0,2,3],[1.0,2,3])
56-
f(out,[1.0,2,3],[1.0,2,3])
54+
f_iip(out,[1.0,2,3],[1.0,2,3])
5755
end
5856
test_worldage()
5957

@@ -104,12 +102,10 @@ function test_worldage()
104102
eqs = [(y-x)^2,
105103
x*(x-z)-y,
106104
x*y - y*z]
107-
_f = eval(ModelingToolkit.build_function(eqs,[x,y,z]))
108-
f(u) = ModelingToolkit.fast_invokelatest(_f,typeof(u),u)
109-
f(du,u) = ModelingToolkit.fast_invokelatest(_f,Nothing,du,u)
105+
f, f_iip = ModelingToolkit.build_function(eqs,[x,y,z],(),ModelingToolkit.simplified_expr,Val{false})
110106
out = zeros(3)
111107
o1 = f([1.0,2,3])
112-
f(out,[1.0,2,3])
108+
f_iip(out,[1.0,2,3])
113109
end
114110
test_worldage()
115111

0 commit comments

Comments
 (0)