Skip to content

Commit

Permalink
Merge pull request #91 from SciML/extension
Browse files Browse the repository at this point in the history
Move extension to Symbolics
  • Loading branch information
ChrisRackauckas authored Dec 31, 2023
2 parents b52a345 + 9352330 commit 0b194df
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 75 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PreallocationTools"
uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
authors = ["Chris Rackauckas <[email protected]>"]
version = "0.4.15"
version = "0.4.16"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -10,11 +10,9 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"

[weakdeps]
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[extensions]
PreallocationToolsReverseDiffExt = "ReverseDiff"
PreallocationToolsSymbolicsExt = "Symbolics"

[compat]
Adapt = "3.4, 4"
Expand Down
49 changes: 0 additions & 49 deletions ext/PreallocationToolsSymbolicsExt.jl

This file was deleted.

23 changes: 0 additions & 23 deletions test/sparsity_support.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,3 @@ A = Symbolics.jacobian_sparsity(wrap_res_dae_cache!, output, x0)
B = sparse([1 0; 0 1])
@test A == B
@test findnz(A) == findnz(B)

# Test Nesting https://discourse.julialang.org/t/preallocationtools-jl-with-nested-forwarddiff-and-sparsity-pattern-detection-errors/107897

function foo(x, cache)
d = get_tmp(cache, x)

d[:] = x

0.5 * x'*x
end

function residual(r, x, cache)
function foo_wrap(x)
foo(x, cache)
end

r[:] = ForwardDiff.gradient(foo_wrap, x)
end

cache = DiffCache(zeros(2))
pattern = Symbolics.jacobian_sparsity((r, x) -> residual(r, x, cache), zeros(2), zeros(2))
@test pattern == sparse([1 0
0 1])

0 comments on commit 0b194df

Please sign in to comment.