@@ -14,7 +14,7 @@ for TYP in (:PiecewiseSpace,:ArraySpace)
14
14
end
15
15
function interlace_choosedomainspace (ops,rs:: $TYP )
16
16
@assert length (ops) == length (rs)
17
- # this ensures correct dispatch for unino
17
+ # this ensures correct dispatch for union
18
18
sps = Array {Space} (
19
19
filter (x-> ! isambiguous (x),map ((op,s)-> choosedomainspace (op,s),ops,rs)))
20
20
if isempty (sps)
@@ -222,25 +222,33 @@ end
222
222
# TODO : do in @calculus_operator?
223
223
224
224
for (Op,OpWrap) in ((:Derivative ,:DerivativeWrapper ),(:Integral ,:IntegralWrapper ))
225
+ _Op = Symbol (:_ , Op)
225
226
@eval begin
226
- function $Op (S:: PiecewiseSpace , k:: Number )
227
+ @inline function $_Op (S:: PiecewiseSpace , k:: Number )
227
228
assert_integer (k)
228
229
t = map (s-> $ Op (s,k),components (S))
229
230
D = Diagonal (convert_vector_or_svector (t))
230
231
O = InterlaceOperator (D, PiecewiseSpace)
231
232
$ OpWrap (O,k)
232
233
end
233
- function $Op (S:: ArraySpace , k:: Number )
234
+ @inline function $_Op (S:: ArraySpace , k:: Number )
234
235
assert_integer (k)
235
236
ops = map (s-> $ Op (s,k),S)
236
237
RS = ArraySpace (reshape (map (rangespace, ops), size (S)))
237
238
O = InterlaceOperator (Diagonal (ops), S, RS)
238
239
$ OpWrap (O,k)
239
240
end
241
+ @static if VERSION >= v " 1.8"
242
+ Base. @constprop :aggressive $ Op (s:: PiecewiseSpace , k:: Number ) = $ _Op (s, k)
243
+ Base. @constprop :aggressive $ Op (s:: ArraySpace , k:: Number ) = $ _Op (s, k)
244
+ else
245
+ $ Op (s:: PiecewiseSpace , k:: Number ) = $ _Op (s, k)
246
+ $ Op (s:: ArraySpace , k:: Number ) = $ _Op (s, k)
247
+ end
240
248
end
241
249
end
242
250
243
- function Derivative (S:: SumSpace , k:: Number )
251
+ @inline function _Derivative (S:: SumSpace , k:: Number )
244
252
assert_integer (k)
245
253
# we want to map before we decompose, as the map may introduce
246
254
# mixed bases.
@@ -254,6 +262,12 @@ function Derivative(S::SumSpace, k::Number)
254
262
end
255
263
end
256
264
265
+ @static if VERSION >= v " 1.8"
266
+ Base. @constprop :aggressive Derivative (s:: SumSpace , k:: Number ) = _Derivative (s, k)
267
+ else
268
+ Derivative (s:: SumSpace , k:: Number ) = _Derivative (s, k)
269
+ end
270
+
257
271
choosedomainspace (M:: CalculusOperator{UnsetSpace} ,sp:: SumSpace )= mapreduce (s-> choosedomainspace (M,s),union,sp. spaces)
258
272
259
273
# # Multiplcation for Array*Vector
0 commit comments