1
1
using DiffEqBase, Test, RecursiveArrayTools
2
+ import SciMLBase: AbstractSciMLFunction
2
3
3
4
macro iop_def (funcdef:: Expr )
4
5
""" Define in- and out-of-place functions simultaneously.
@@ -21,19 +22,19 @@ macro iop_def(funcdef::Expr)
21
22
end
22
23
end
23
24
24
- function test_inplace (du, expected, f:: Function , args... )
25
+ function test_inplace (du, expected, f:: AbstractSciMLFunction , args... )
25
26
""" Test the in-place version of a function."""
26
27
fill! (du, NaN )
27
28
f (du, args... )
28
29
@test du == expected
29
30
end
30
31
31
32
# Allocate du automatically based on type of expected result
32
- function test_inplace (expected, f:: Function , args... )
33
+ function test_inplace (expected, f:: AbstractSciMLFunction , args... )
33
34
test_inplace (similar (expected), expected, f, args... )
34
35
end
35
36
36
- function test_iop (expected, f_op:: Function , f_ip:: Function , args... )
37
+ function test_iop (expected, f_op:: AbstractSciMLFunction , f_ip:: AbstractSciMLFunction , args... )
37
38
""" Test in- and out-of-place version of function both match expected value."""
38
39
@test f_op (args... ) == expected
39
40
test_inplace (expected, f_ip, args... )
0 commit comments