Skip to content

Turn DualNumbers into an extension #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
Expand All @@ -26,9 +25,11 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"

[extensions]
ApproxFunBaseTestExt = "Test"
ApproxFunBaseDualNumbersExt = "DualNumbers"

[compat]
AbstractFFTs = "0.5, 1"
Expand Down Expand Up @@ -59,9 +60,10 @@ julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Random", "Infinities", "Test"]
test = ["Aqua", "DualNumbers", "Random", "Infinities", "Test"]
9 changes: 9 additions & 0 deletions ext/ApproxFunBaseDualNumbersExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module ApproxFunBaseDualNumbersExt

using DualNumbers: Dual
import ApproxFunBase: eps

eps(::Type{Dual{Complex{T}}}) where {T<:Real} = eps(real(T))
eps(z::Dual{Complex{T}}) where {T<:Real} = eps(abs(z))

end
1 change: 0 additions & 1 deletion src/ApproxFunBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Calculus
import Combinatorics: multiexponents
using DSP
using DomainSets
using DualNumbers
using FFTW
using FillArrays
using InfiniteArrays
Expand Down
2 changes: 0 additions & 2 deletions src/LinearAlgebra/helper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ eps(::T) where T<:Integer = eps(T)

eps(::Type{Complex{T}}) where {T<:Real} = eps(real(T))
eps(z::Complex{T}) where {T<:Real} = eps(abs(z))
eps(::Type{Dual{Complex{T}}}) where {T<:Real} = eps(real(T))
eps(z::Dual{Complex{T}}) where {T<:Real} = eps(abs(z))


eps(::Type{Vector{T}}) where {T<:Number} = eps(T)
Expand Down
Loading