Skip to content

Commit

Permalink
add AD hook for abs() per DiffRules
Browse files Browse the repository at this point in the history
  • Loading branch information
agerlach committed Jun 14, 2023
1 parent 4404658 commit eb2297f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.20.9"

[deps]
CRlibm = "96374032-68de-5a5b-8d9e-752f78720389"
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
FastRounding = "fa42c844-2597-5d31-933b-ebd51ab2693f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand All @@ -16,8 +17,9 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
CRlibm = "0.7, 0.8, 1"
IntervalContractors = "0.4"
DiffRules = "1.0"
FastRounding = "0.2, 0.3"
IntervalContractors = "0.4"
Polynomials = "0.7, 1, 2, 3"
RecipesBase = "1.0"
RoundingEmulator = "0.2"
Expand All @@ -26,10 +28,11 @@ StaticArrays = "0.8, 0.9, 0.10, 0.11, 0.12, 1.0"
julia = "1.5"

[extras]
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
IntervalContractors = "15111844-de3b-5229-b4ba-526f2f385dc9"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["IntervalContractors", "LinearAlgebra", "Test", "Polynomials"]
test = ["ForwardDiff", "IntervalContractors", "LinearAlgebra", "Test", "Polynomials"]
3 changes: 3 additions & 0 deletions src/IntervalArithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import Base.MPFR: MPFRRoundUp, MPFRRoundDown, MPFRRoundNearest, MPFRRoundToZero,

import .Broadcast: broadcasted

import DiffRules._abs_deriv

export
AbstractInterval, Interval,
interval,
Expand Down Expand Up @@ -108,6 +110,7 @@ include("intervals/intervals.jl")
include("multidim/multidim.jl")
include("bisect.jl")
include("decorations/decorations.jl")
include("ad.jl")

include("rand.jl")
include("parsing.jl")
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ include("interval_tests/intervals.jl")
include("decoration_tests/decoration_tests.jl")

include("rand.jl")
include("interval_tests/ad.jl")

# Display tests:
include("display_tests/display.jl")
Expand Down

0 comments on commit eb2297f

Please sign in to comment.