From dd075b082898189239ae17de8f2ade5e7a85115c Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 15 Jul 2021 14:03:59 +0100 Subject: [PATCH 1/5] Avoid conj override message --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index edfb55d9..7428835d 100644 --- a/Project.toml +++ b/Project.toml @@ -17,7 +17,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Calculus = "0.2, 0.3, 0.4, 0.5" CommonSubexpressions = "0.3" DiffResults = "0.0.1, 0.0.2, 0.0.3, 0.0.4, 1.0.1" -DiffRules = "0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.1, 1.0" +DiffRules = "1.1" DiffTests = "0.0.1, 0.1" NaNMath = "0.2.2, 0.3" SpecialFunctions = "0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 1.0" From 9c66dd2335a5af9f3ba35a8b75da5a28be30c0c3 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 15 Jul 2021 14:05:05 +0100 Subject: [PATCH 2/5] remove conj override --- src/dual.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dual.jl b/src/dual.jl index 81745f07..a37445ac 100644 --- a/src/dual.jl +++ b/src/dual.jl @@ -387,8 +387,6 @@ Base.AbstractFloat(d::Dual{T,V,N}) where {T,V,N} = convert(Dual{T,promote_type(V # General Mathematical Operations # ################################### -@inline Base.conj(d::Dual) = d - for (M, f, arity) in DiffRules.diffrules() in((M, f), ((:Base, :^), (:NaNMath, :pow), (:Base, :/), (:Base, :+), (:Base, :-))) && continue if arity == 1 From a1b7aeb8a7fadc6c91beb93c8fd2fa61341cd116 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 15 Jul 2021 15:27:55 +0100 Subject: [PATCH 3/5] Revert "Avoid conj override message" This reverts commit dd075b082898189239ae17de8f2ade5e7a85115c. --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 7428835d..edfb55d9 100644 --- a/Project.toml +++ b/Project.toml @@ -17,7 +17,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Calculus = "0.2, 0.3, 0.4, 0.5" CommonSubexpressions = "0.3" DiffResults = "0.0.1, 0.0.2, 0.0.3, 0.0.4, 1.0.1" -DiffRules = "1.1" +DiffRules = "0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.1, 1.0" DiffTests = "0.0.1, 0.1" NaNMath = "0.2.2, 0.3" SpecialFunctions = "0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 1.0" From b64e3f187ddc09c574cdba6ecb467f2354b1e17d Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 15 Jul 2021 15:28:03 +0100 Subject: [PATCH 4/5] Revert "remove conj override" This reverts commit 9c66dd2335a5af9f3ba35a8b75da5a28be30c0c3. --- src/dual.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dual.jl b/src/dual.jl index a37445ac..81745f07 100644 --- a/src/dual.jl +++ b/src/dual.jl @@ -387,6 +387,8 @@ Base.AbstractFloat(d::Dual{T,V,N}) where {T,V,N} = convert(Dual{T,promote_type(V # General Mathematical Operations # ################################### +@inline Base.conj(d::Dual) = d + for (M, f, arity) in DiffRules.diffrules() in((M, f), ((:Base, :^), (:NaNMath, :pow), (:Base, :/), (:Base, :+), (:Base, :-))) && continue if arity == 1 From dc7cf96d020e93b6b2f37bb1fff68cd685b06742 Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Thu, 15 Jul 2021 15:28:37 +0100 Subject: [PATCH 5/5] Update dual.jl --- src/dual.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dual.jl b/src/dual.jl index 81745f07..1e5af9e5 100644 --- a/src/dual.jl +++ b/src/dual.jl @@ -387,7 +387,9 @@ Base.AbstractFloat(d::Dual{T,V,N}) where {T,V,N} = convert(Dual{T,promote_type(V # General Mathematical Operations # ################################### -@inline Base.conj(d::Dual) = d +if !hasmethod(conj, Tuple{ForwardDiff.Dual}) + @inline Base.conj(d::Dual) = d +end for (M, f, arity) in DiffRules.diffrules() in((M, f), ((:Base, :^), (:NaNMath, :pow), (:Base, :/), (:Base, :+), (:Base, :-))) && continue