@@ -126,8 +126,8 @@ Base.promote_op(::typeof(LinearAlgebra.matprod),::Type{NN},::Type{Fun{S,T,VT}})
126
126
zero (:: Type{Fun} ) = Fun (0. )
127
127
zero (:: Type{Fun{S,T,VT}} ) where {T,S<: Space ,VT} = zeros (T,S (AnyDomain ()))
128
128
one (:: Type{Fun{S,T,VT}} ) where {T,S<: Space ,VT} = ones (T,S (AnyDomain ()))
129
- zero (f:: Fun{S,T} ) where {S,T} = zeros (T,f . space)
130
- one (f:: Fun{S,T} ) where {S,T} = ones (T,f . space)
129
+ zero (f:: Fun ) = zeros (cfstype (f), space (f) )
130
+ one (f:: Fun ) = ones (cfstype (f), space (f) )
131
131
132
132
cfstype (:: Fun{S,T} ) where {S,T} = T
133
133
cfstype (:: Type{Fun{S,T,VT}} ) where {S,T,VT} = T
@@ -218,7 +218,7 @@ evaluate(f::Fun,x,y,z...) = evaluate(f.coefficients,f.space,Vec(x,y,z...))
218
218
dynamic (f:: Fun ) = f # Fun's are already dynamic in that they compile by type
219
219
220
220
for (op,dop) in ((:first ,:leftendpoint ),(:last ,:rightendpoint ))
221
- @eval $ op (f:: Fun{S,T} ) where {S,T} = f ($ dop (domain (f)))
221
+ @eval $ op (f:: Fun ) = f ($ dop (domain (f)))
222
222
end
223
223
224
224
@@ -406,7 +406,7 @@ for (OP,SUM) in ((:(norm),:(sum)),(:linenorm,:linesum))
406
406
@eval begin
407
407
$ OP (f:: Fun ) = $ OP (f,2 )
408
408
409
- function $OP (f:: Fun{S} ,p :: Real ) where S <: Space{D,R} where {D,R <: Number }
409
+ function $OP (f:: Fun{<:Space{<:Any, <:Number}} , p :: Real )
410
410
if p < 1
411
411
return error (" p should be 1 ≤ p ≤ ∞" )
412
412
elseif 1 ≤ p < Inf
@@ -416,7 +416,7 @@ for (OP,SUM) in ((:(norm),:(sum)),(:linenorm,:linesum))
416
416
end
417
417
end
418
418
419
- function $OP (f:: Fun{S} ,p :: Int ) where S <: Space{D,R} where {D,R <: Number }
419
+ function $OP (f:: Fun{<:Space{<:Any, <:Number}} , p :: Int )
420
420
if 1 ≤ p < Inf
421
421
return iseven (p) ? abs ($ SUM (abs2 (f)^ (p÷ 2 )))^ (1 / p) : abs ($ SUM (abs2 (f)^ (p/ 2 )))^ (1 / p)
422
422
else
@@ -432,13 +432,13 @@ end
432
432
transpose (f:: Fun ) = f # default no-op
433
433
434
434
for op = (:real , :imag , :conj )
435
- @eval Base.$ op (f:: Fun{S} ) where {S <: RealSpace } = Fun (f. space, ($ op)(f. coefficients))
435
+ @eval Base.$ op (f:: Fun{<:RealSpace} ) = Fun (f. space, ($ op)(f. coefficients))
436
436
end
437
437
438
438
conj (f:: Fun ) = error (" Override conj for $(typeof (f)) " )
439
439
440
- abs2 (f:: Fun{S,T} ) where {S <: RealSpace ,T <: Real } = f^ 2
441
- abs2 (f:: Fun{S,T} ) where {S <: RealSpace ,T <: Complex } = real (f)^ 2 + imag (f)^ 2
440
+ abs2 (f:: Fun{<:RealSpace,<:Real} ) = f^ 2
441
+ abs2 (f:: Fun{<:RealSpace,<:Complex} ) = real (f)^ 2 + imag (f)^ 2
442
442
abs2 (f:: Fun )= f* conj (f)
443
443
444
444
# # integration
@@ -478,7 +478,8 @@ Base.rtoldefault(x::Union{T,Type{T}}, y::Union{S,Type{S}}, atol) where {T<:Fun,S
478
478
Base. rtoldefault (cfstype (x),cfstype (y), atol)
479
479
480
480
481
- function isapprox (f:: Fun{S1,T} ,g:: Fun{S2,S} ;rtol:: Real = Base. rtoldefault (T,S,0 ), atol:: Real = 0 , norm:: Function = coefficientnorm) where {S1,S2,T,S}
481
+ function isapprox (f:: Fun ,g:: Fun ;
482
+ rtol:: Real = Base. rtoldefault (cfstype (f),cfstype (g),0 ), atol:: Real = 0 , norm:: Function = coefficientnorm)
482
483
if spacescompatible (f,g)
483
484
d = norm (f - g)
484
485
if isfinite (d)
0 commit comments