Skip to content

Commit 9f4e441

Browse files
add tests for Jacobians of LabelledArrays
1 parent 54082de commit 9f4e441

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/labelledarrays.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ eqs = [D(x) ~ σ*(y-x),
1313
D(z) ~ x*y - β*z]
1414

1515
de = ODESystem(eqs)
16-
f = ODEFunction(de, [x,y,z], [σ,ρ,β])
16+
ff = ODEFunction(de, [x,y,z], [σ,ρ,β], jac=true)
1717

1818
a = @SVector [1.0,2.0,3.0]
1919
b = SLVector(x=1.0,y=2.0,z=3.0)
2020
c = [1.0,2.0,3.0]
2121
p = SLVector=10.0=26.0=8/3)
22-
@test f(a,p,0.0) isa SVector
23-
@test typeof(f(b,p,0.0)) <: SLArray
24-
@test f(c,p,0.0) isa Vector
25-
@test f(a,p,0.0) == f(b,p,0.0)
26-
@test f(a,p,0.0) == f(c,p,0.0)
22+
@test ff(a,p,0.0) isa SVector
23+
@test typeof(ff(b,p,0.0)) <: SLArray
24+
@test ff(c,p,0.0) isa Vector
25+
@test ff(a,p,0.0) == ff(b,p,0.0)
26+
@test ff(a,p,0.0) == ff(c,p,0.0)
27+
28+
@test ff.jac(a,p,0.0) isa SMatrix
29+
@test typeof(ff.jac(b,p,0.0)) <: SMatrix
30+
@test ff.jac(c,p,0.0) isa Matrix
31+
@test ff.jac(a,p,0.0) == ff.jac(b,p,0.0)
32+
@test ff.jac(a,p,0.0) == ff.jac(c,p,0.0)

0 commit comments

Comments
 (0)