-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite of DualNumbers to support Dual{Complex}
- remove dual() constructor (float() is deprecated in 0.4 anyways) - replace real & epsilon with value and dual - change du to ɛ addressing #24 - add Base.sinpi and Base.cospi as a patch addressing #23 - add complex function tests add 2-norm(Vector{Dual}) add cis (cos+im*sin) update readme to reflect more general support fixes dual => epsilon re-add vectorized constructor dual deprecate_binding du release => 0.4 and deprecate real(::Dual) dual => epsilon in readme un-export value incorporate some changes of #28: __precompile()__ function => constructor in readme import value in test add definitions for non-complex differentiable functions and tests all generic norms work with isinf() and float() fix print so that you can copy paste and it will make a new Dual add limit definition in readme fix typo: float is a no-op on Union{Dual{T},Dual{Complex{T}}}, not Union{Dual{T},Complex{T}} add no-op real{T<:Real} add angle, realpart, and dualpart deprecate real{T<:Real}(z::Dual{T}). also, because sign := z/|z| in base, it works automatically and so #22 is no longer necessary. remove value(z::Number) and epsilon(z::Number) - add the constant imɛ - add special dual_show methods for Dual{Bool}’s and Dual{Complex{Bool}}’s - replace real with DualNumbers.value - change du to ɛ addressing #24 - add imɛ - add Base.sinpi and Base.cospi as a patch addressing #23 - add cis (cos+im*sin) - deprecate_binding du - remove 0.3 from Travis build (and therefore support) - deprecate real(::Dual) - (real,epsilon) => (realpart,dualpart) in readme - incorporate some changes of #28: -- __precompile()__ - function => constructor in readme - add isinf() and float() so that all generic norms work - add show_dual{T<:Complex} so that you can copy paste and it will make a new Dual - add show_dual{T<:Bool} and show_dual{T<:Complex{Bool}} - add limit definition in readme - add angle, realpart, and dualpart - deprecate real{T<:Real}(z::Dual{T}) - sign := z/|z| in base, it works automatically and so #22 is no longer necessary - add tests
- Loading branch information
1 parent
ca3a9ec
commit 5bc6760
Showing
6 changed files
with
328 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
julia 0.3 | ||
julia 0.4 | ||
Calculus | ||
NaNMath | ||
Compat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
isdefined(Base, :__precompile__) && __precompile__() | ||
__precompile__() | ||
|
||
module DualNumbers | ||
importall Base | ||
|
||
using Compat | ||
import NaNMath | ||
import Calculus | ||
|
||
include("dual.jl") | ||
include("dual_n.jl") | ||
|
||
Base.@deprecate_binding du ɛ | ||
@deprecate inf{T}(::Type{Dual{T}}) convert(Dual{T}, Inf) | ||
@deprecate nan{T}(::Type{Dual{T}}) convert(Dual{T}, NaN) | ||
@deprecate real{T<:Real}(z::Dual{T}) realpart(z) | ||
|
||
export | ||
Dual, | ||
Dual128, | ||
Dual64, | ||
DualPair, | ||
Dual32, | ||
DualComplex256, | ||
DualComplex128, | ||
DualComplex64, | ||
dual, | ||
dual128, | ||
dual64, | ||
epsilon, | ||
realpart, | ||
dualpart, | ||
isdual, | ||
dual_show, | ||
epsilon, | ||
conjdual, | ||
absdual, | ||
abs2dual, | ||
du | ||
ɛ, | ||
imɛ | ||
end |
Oops, something went wrong.