@@ -7,7 +7,7 @@ subtypes, as we know the full set that might be encountered.
77Thus we can avoid any ambiguities.
88
99Notice:
10- The precidence goes: (:Wirtinger, :Casted, : Zero, :DNE, :One, :AbstractThunk, :Any)
10+ The precidence goes: (:Wirtinger, :Zero, :DNE, :One, :AbstractThunk, :Any)
1111 Thus each of the @eval loops creating definitions of + and *
1212 defines the combination this type with all types of lower precidence.
1313 This means each eval loops is 1 item smaller than the previous.
@@ -36,7 +36,7 @@ function Base.:+(a::Wirtinger, b::Wirtinger)
3636 return Wirtinger (+ (a. primal, b. primal), a. conjugate + b. conjugate)
3737end
3838
39- for T in (:Casted , : Zero , :DNE , :One , :AbstractThunk , :Any )
39+ for T in (:Zero , :DNE , :One , :AbstractThunk , :Any )
4040 @eval Base.:+ (a:: Wirtinger , b:: $T ) = a + Wirtinger (b, Zero ())
4141 @eval Base.:+ (a:: $T , b:: Wirtinger ) = Wirtinger (a, Zero ()) + b
4242
@@ -45,17 +45,6 @@ for T in (:Casted, :Zero, :DNE, :One, :AbstractThunk, :Any)
4545end
4646
4747
48- Base.:+ (a:: Casted , b:: Casted ) = Casted (broadcasted (+ , a. value, b. value))
49- Base.:* (a:: Casted , b:: Casted ) = Casted (broadcasted (* , a. value, b. value))
50- for T in (:Zero , :DNE , :One , :AbstractThunk , :Any )
51- @eval Base.:+ (a:: Casted , b:: $T ) = Casted (broadcasted (+ , a. value, b))
52- @eval Base.:+ (a:: $T , b:: Casted ) = Casted (broadcasted (+ , a, b. value))
53-
54- @eval Base.:* (a:: Casted , b:: $T ) = Casted (broadcasted (* , a. value, b))
55- @eval Base.:* (a:: $T , b:: Casted ) = Casted (broadcasted (* , a, b. value))
56- end
57-
58-
5948Base.:+ (:: Zero , b:: Zero ) = Zero ()
6049Base.:* (:: Zero , :: Zero ) = Zero ()
6150for T in (:DNE , :One , :AbstractThunk , :Any )
0 commit comments