Skip to content

Commit cb64c72

Browse files
authored
fix dualnumbers real/eps part (#793)
1 parent f9040da commit cb64c72

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFun"
22
uuid = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
3-
version = "0.13.6"
3+
version = "0.13.7"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaApproximation.github.io/ApproxFun.jl/stable)
44
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://JuliaApproximation.github.io/ApproxFun.jl/latest)
5-
[![Build Status](https://travis-ci.org/JuliaApproximation/ApproxFun.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/ApproxFun.jl)
5+
[![Build Status](https://travis-ci.org/JuliaApproximation/ApproxFun.jl.svg?branch=master)](https://travis-ci.org/JuliaApproximation/ApproxFun.jl)
66
[![Build status](https://ci.appveyor.com/api/projects/status/40qmoxp189pwtuda?svg=true)](https://ci.appveyor.com/project/dlfivefifty/approxfun-jl)
77
[![codecov](https://codecov.io/gh/JuliaApproximation/ApproxFun.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaApproximation/ApproxFun.jl)
88
[![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)
99

1010

1111

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

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

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

src/Extras/dualnumbers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
real(::Type{Dual{T}}) where {T} = Dual{ApproxFun.real(T)}
33

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

88

99
DualNumbers.realpart(d::Segment{<:Dual}) = Segment(realpart(leftendpoint(d)),realpart(rightendpoint(d)))

test/ExtrasTest.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ import ApproxFun: eigs
4444
ud = [B;D+a] \ [2.0,0.0]
4545
@test absdual(u(0.5) - dual(ur(0.5),ud(0.5))) < 10eps()
4646
end
47+
48+
f=Fun(x->exp(dual(x,1)),-1..1)
49+
@test coefficients(realpart(f)) == realpart.(coefficients(f))
50+
@test coefficients(dualpart(f)) == dualpart.(coefficients(f))
4751
end
4852

4953
@testset "Eig test #336" begin

0 commit comments

Comments
 (0)