@@ -26,9 +26,15 @@ Sets the algorithm used to perform matrix multiplication with interval matrices.
2626"""
2727function set_multiplication_mode (multype)
2828 type = MultiplicationType {multype} ()
29- @eval * (A:: AbstractMatrix{Interval{T}} where T , B:: AbstractMatrix{Interval{T}} where T) =
29+ @eval * (A:: AbstractMatrix{Interval{T}} , B:: AbstractMatrix{Interval{T}} ) where T =
3030 * ($ type, A, B)
3131
32+ @eval * (A:: AbstractMatrix{T} , B:: AbstractMatrix{Interval{T}} ) where T = * ($ type, A, B)
33+
34+ @eval * (A:: AbstractMatrix{Interval{T}} , B:: AbstractMatrix{T} ) where T = * ($ type, A, B)
35+
36+ @eval * (A:: Diagonal , B:: AbstractMatrix{Interval{T}} ) where T = * ($ type, A, B)
37+ @eval * (A:: AbstractMatrix{Interval{T}} , B:: Diagonal ) where T = * ($ type, A, B)
3238 config[:multiplication ] = multype
3339end
3440
@@ -66,6 +72,58 @@ function *(::MultiplicationType{:fast},
6672 return Interval .(Cinf, Csup)
6773end
6874
75+
76+ function * (:: MultiplicationType{:fast} ,
77+ A:: AbstractMatrix{T} ,
78+ B:: AbstractMatrix{Interval{T}} ) where {T<: Real }
79+
80+ Binf = inf .(B)
81+ Bsup = sup .(B)
82+
83+ mB, R, Csup = setrounding (T, RoundUp) do
84+ mB = Binf + 0.5 * (Bsup - Binf)
85+
86+ rB = mB - Binf
87+
88+ R = abs .(A) * rB
89+ Csup = A * mB + R
90+
91+ return mB, R, Csup
92+ end
93+
94+ Cinf = setrounding (T, RoundDown) do
95+ A * mB - R
96+ end
97+
98+ return Interval .(Cinf, Csup)
99+ end
100+
101+ function * (:: MultiplicationType{:fast} ,
102+ A:: AbstractMatrix{Interval{T}} ,
103+ B:: AbstractMatrix{T} ) where {T<: Real }
104+
105+ Ainf = inf .(A)
106+ Asup = sup .(A)
107+
108+ mA, R, Csup = setrounding (T, RoundUp) do
109+ mA = Ainf + 0.5 * (Asup - Ainf)
110+
111+ rA = mA - Ainf
112+
113+ R = rA * abs .(B)
114+ Csup = mA * B + R
115+
116+ return mA, R, Csup
117+ end
118+
119+ Cinf = setrounding (T, RoundDown) do
120+ mA * B - R
121+ end
122+
123+ return Interval .(Cinf, Csup)
124+ end
125+
126+
69127function * (:: MultiplicationType{:rank1} ,
70128 A:: AbstractMatrix{Interval{T}} ,
71129 B:: AbstractMatrix{Interval{T}} ) where {T<: Real }
0 commit comments