Skip to content

Commit

Permalink
fix dualnumbers real/eps part (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Aug 8, 2022
1 parent f9040da commit cb64c72
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFun"
uuid = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
version = "0.13.6"
version = "0.13.7"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaApproximation.github.io/ApproxFun.jl/stable)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaApproximation.github.io/ApproxFun.jl/latest)
[![Build Status](https://travis-ci.org/JuliaApproximation/ApproxFun.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/ApproxFun.jl)
[![Build Status](https://travis-ci.org/JuliaApproximation/ApproxFun.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/ApproxFun.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/40qmoxp189pwtuda?svg=true)](https://ci.appveyor.com/project/dlfivefifty/approxfun-jl)
[![codecov](https://codecov.io/gh/JuliaApproximation/ApproxFun.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaApproximation/ApproxFun.jl)
[![Join the chat at https://gitter.im/JuliaApproximation/ApproxFun.jl](https://badges.gitter.im/JuliaApproximation/ApproxFun.jl.svg)](https://gitter.im/JuliaApproximation/ApproxFun.jl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)



ApproxFun is a package for approximating functions. It is in a similar vein to the Matlab
package [`Chebfun`](http://www.chebfun.org) and the Mathematica package [`RHPackage`](https://github.com/dlfivefifty/RHPackage).
package [`Chebfun`](http://www.chebfun.org) and the Mathematica package [`RHPackage`](https://github.com/dlfivefifty/RHPackage).

The [`ApproxFun Documentation`](https://JuliaApproximation.github.io/ApproxFun.jl/latest) contains detailed information, or read on for a brief overview of the package.

Expand Down Expand Up @@ -197,7 +197,7 @@ d = ChebyshevInterval()^2 # Defines a rectangle
Δ = Laplacian(d) # Represent the Laplacian
f = ones((d)) # one at the boundary
u = \([Dirichlet(d); Δ+100I], [f;0.]; # Solve the PDE
tolerance=1E-5)
tolerance=1E-5)
surface(u) # Surface plot
```

Expand Down
4 changes: 2 additions & 2 deletions src/Extras/dualnumbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
real(::Type{Dual{T}}) where {T} = Dual{ApproxFun.real(T)}

# Dual number support. Should there be realpart and dualpart of Space and Domain?
DualNumbers.realpart(f::Fun{S,T}) where {S,T<:Dual} = Fun(space(f),realpart(coefficients(f)))
DualNumbers.dualpart(f::Fun{S,T}) where {S,T<:Dual} = Fun(space(f),dualpart(coefficients(f)))
DualNumbers.realpart(f::Fun{S,T}) where {S,T<:Dual} = Fun(space(f),realpart.(coefficients(f)))
DualNumbers.dualpart(f::Fun{S,T}) where {S,T<:Dual} = Fun(space(f),dualpart.(coefficients(f)))


DualNumbers.realpart(d::Segment{<:Dual}) = Segment(realpart(leftendpoint(d)),realpart(rightendpoint(d)))
Expand Down
4 changes: 4 additions & 0 deletions test/ExtrasTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ import ApproxFun: eigs
ud = [B;D+a] \ [2.0,0.0]
@test absdual(u(0.5) - dual(ur(0.5),ud(0.5))) < 10eps()
end

f=Fun(x->exp(dual(x,1)),-1..1)
@test coefficients(realpart(f)) == realpart.(coefficients(f))
@test coefficients(dualpart(f)) == dualpart.(coefficients(f))
end

@testset "Eig test #336" begin
Expand Down

2 comments on commit cb64c72

@jishnub
Copy link
Member Author

@jishnub jishnub commented on cb64c72 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65920

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.7 -m "<description of version>" cb64c72de20a1270e750e0cf85294a8116f18de5
git push origin v0.13.7

Please sign in to comment.