Skip to content
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

Transfer DualNumbers implementation from ForwardDiff #49

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Start deprecating APIs
[ci skip]
ranjanan committed Feb 14, 2017
commit 8d95b3153f48e4837b8a621150ea4b5aba29ed18
24 changes: 21 additions & 3 deletions src/DualNumbers.jl
Original file line number Diff line number Diff line change
@@ -17,10 +17,28 @@ module DualNumbers

include("partials.jl")
include("dual.jl")
include("deprecate.jl")

export Dual,
value,
partials


partials

export
Dual128,
Dual64,
Dual32,
epsilon
#=DualComplex256,
DualComplex128,
DualComplex64,
dual,
realpart,
dualpart,
isdual,
dual_show,
conjdual,
absdual,
abs2dual,
ɛ,
imɛ
end
4 changes: 4 additions & 0 deletions src/deprecate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@deprecate epsilon(d) partials(d)
@deprecate Dual128(a,b) Dual(a,b)
@deprecate Dual64(a,b) Dual(a,b)
@deprecate Dual32(a,b) Dual(a,b)
4 changes: 4 additions & 0 deletions src/dual.jl
Original file line number Diff line number Diff line change
@@ -404,6 +404,10 @@ end
###################

function Base.show{N}(io::IO, n::Dual{N})
if N == 0
print(io, value(n))
return
end
print(io, value(n))
print(io, " + ")
for i in 1:N-1