@@ -11,29 +11,6 @@ using PrecompileTools
11
11
isdefined (Base, :get_extension ) ? (using FastDifferentiation) : (using .. FastDifferentiation)
12
12
13
13
14
- # ## TYPE PIRACY!!!
15
- # The following Base functions should be added to FastDifferentiation itself; meanwhile
16
- # we'll define them here.
17
-
18
- # This is a workaround that should be fixed in FastDifferentiation.jl; Elaine will probably
19
- # make a PR to fix this. The problem is that FD only defines
20
- # `Base.promote_rule(::Type{<:Real}, ::Type{Node})`. But julia/src/bool.jl defines
21
- # `promote_rule(::Type{Bool}, ::Type{T}) where T<:Number` and `Node <: Number`, so there is
22
- # an ambiguity.
23
- Base. promote_rule (:: Type{Bool} , :: Type{FastDifferentiation.Node} ) = FastDifferentiation. Node
24
-
25
- # These are essentially copied from Symbolics.jl:
26
- # https://github.com/JuliaSymbolics/Symbolics.jl/blob/e4c328103ece494eaaab2a265524a64bfbe43dbd/src/num.jl#L31-L34
27
- Base. eps (:: Type{FastDifferentiation.Node} ) = FastDifferentiation. Node (0 )
28
- Base. typemin (:: Type{FastDifferentiation.Node} ) = FastDifferentiation. Node (- Inf )
29
- Base. typemax (:: Type{FastDifferentiation.Node} ) = FastDifferentiation. Node (Inf )
30
- Base. float (x:: FastDifferentiation.Node ) = x
31
-
32
- # This one is needed because julia/base/float.jl only defines `isinf` for `Real`, but `Node
33
- # <: Number`. (See https://github.com/brianguenter/FastDifferentiation.jl/issues/73)
34
- Base. isinf (x:: FastDifferentiation.Node ) = ! isnan (x) & ! isfinite (x)
35
-
36
-
37
14
normalize (v:: AbstractVector{FastDifferentiation.Node} ) = v ./ √ sum (x-> x^ 2 , v)
38
15
Base. abs (q:: AbstractQuaternion{FastDifferentiation.Node} ) = √ sum (x-> x^ 2 , components (q))
39
16
Base. abs (q:: QuatVec{FastDifferentiation.Node} ) = √ sum (x-> x^ 2 , vec (q))
0 commit comments