@@ -80,19 +80,23 @@ coefficient(f::Fun,::Colon) = coefficient(f,1:dimension(space(f)))
8080
8181
8282convert (:: Type{Fun{S,T,VT}} ,f:: Fun{S} ) where {T,S,VT} =
83- Fun (f. space,convert (VT,f. coefficients))
84- convert (:: Type{Fun{S,T,VT}} ,f:: Fun ) where {T,S,VT} =
85- Fun (Fun (f. space,convert (VT,f. coefficients)),convert (S,space (f)))
83+ Fun {S,T,VT} (f. space, convert (VT,f. coefficients):: VT )
84+ function convert (:: Type{Fun{S,T,VT}} ,f:: Fun ) where {T,S,VT}
85+ g = Fun (Fun (f. space, convert (VT,f. coefficients):: VT ), convert (S,space (f)):: S )
86+ Fun {S,T,VT} (g. space, g. coefficients)
87+ end
8688
87- convert (:: Type{Fun{S,T}} ,f:: Fun{S} ) where {T,S} =
88- Fun (f. space,convert (AbstractVector{T},f. coefficients))
89+ function convert (:: Type{Fun{S,T}} ,f:: Fun{S} ) where {T,S}
90+ coeff = convert (AbstractVector{T},f. coefficients):: AbstractVector{T}
91+ Fun {S, T, typeof(coeff)} (f. space, coeff)
92+ end
8993
9094
9195convert (:: Type{VFun{S,T}} ,x:: Number ) where {T,S} =
92- x== 0 ? zeros (T,S (AnyDomain ())) : x* ones (T,S (AnyDomain ()))
96+ ( x== 0 ? zeros (T,S (AnyDomain ())) : x* ones (T,S (AnyDomain ()))) :: VFun{S,T}
9397convert (:: Type{Fun{S}} ,x:: Number ) where {S} =
94- x== 0 ? zeros (S (AnyDomain ())) : x* ones (S (AnyDomain ()))
95- convert (:: Type{IF} ,x:: Number ) where {IF<: Fun } = convert (IF,Fun (x))
98+ ( x== 0 ? zeros (S (AnyDomain ())) : x* ones (S (AnyDomain ()))) :: Fun{S}
99+ convert (:: Type{IF} ,x:: Number ) where {IF<: Fun } = convert (IF,Fun (x)):: IF
96100
97101Fun {S,T,VT} (f:: Fun ) where {S,T,VT} = convert (Fun{S,T,VT}, f)
98102Fun {S,T} (f:: Fun ) where {S,T} = convert (Fun{S,T}, f)
0 commit comments