Skip to content

Commit

Permalink
Add test for #847
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Dec 12, 2024
1 parent 72b39f6 commit a764b96
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/diff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,18 @@ let
@test collect(Symbolics.sparsehessian(ex, [a[1]])) == [2;;]
@test collect(Symbolics.sparsehessian(ex, a)) == fill(2, 2, 2)
end

# issue #847
let
@variables x[1:2] y[1:2]
x = Symbolics.scalarize(x)
y = Symbolics.scalarize(y)

z = (x[1] + x[2]) * (y[1] + y[2])
@test Symbolics.islinear(z, x)
@test Symbolics.isaffine(z, x)

z = (x[1] + x[2])
@test Symbolics.islinear(z, x)
@test Symbolics.isaffine(z, x)
end

0 comments on commit a764b96

Please sign in to comment.