3838
3939# default_Fun is the default constructor, based on evaluation and transforms
4040# last argument is whether to splat or not
41- default_Fun (:: Type{T} ,f,d:: Space{ReComp} ,pts:: AbstractArray ,:: Type{Val{true}} ) where {T,ReComp} =
41+ default_Fun (T :: Type ,f,d:: Space ,pts:: AbstractArray ,:: Type{Val{true}} ) =
4242 Fun (d,transform (d,T[f (x... ) for x in pts]))
4343
44- default_Fun (:: Type{T} ,f,d:: Space{ReComp} ,pts:: AbstractArray ,:: Type{Val{false}} ) where {T,ReComp} =
44+ default_Fun (T :: Type ,f,d:: Space ,pts:: AbstractArray ,:: Type{Val{false}} ) =
4545 Fun (d,transform (d,broadcast! (f, similar (pts, T), pts)))
4646
4747
48- function default_Fun (f,d:: Space{ReComp} ,n:: Integer ,:: Type{Val{false}} ) where ReComp
48+ function default_Fun (f,d:: Space ,n:: Integer ,:: Type{Val{false}} )
4949 pts= points (d, n)
5050 f1= f (pts[1 ])
5151 if isa (f1,AbstractArray) && size (d) ≠ size (f1)
@@ -57,7 +57,7 @@ function default_Fun(f,d::Space{ReComp},n::Integer,::Type{Val{false}}) where ReC
5757 default_Fun (Tprom,f,d,pts,Val{false })
5858end
5959
60- function default_Fun (f,d:: Space{ReComp} ,n:: Integer ,:: Type{Val{true}} ) where ReComp
60+ function default_Fun (f,d:: Space ,n:: Integer ,:: Type{Val{true}} )
6161 pts= points (d, n)
6262 f1= f (pts[1 ]. .. )
6363 if isa (f1,AbstractArray) && size (d) ≠ size (f1)
@@ -69,9 +69,9 @@ function default_Fun(f,d::Space{ReComp},n::Integer,::Type{Val{true}}) where ReCo
6969 default_Fun (Tprom,f,d,pts,Val{true })
7070end
7171
72- default_Fun (f,d:: Space{ReComp} ,n:: Integer ) where {ReComp} = default_Fun (f,d,n,Val{! hasnumargs (f,1 )})
72+ default_Fun (f,d:: Space ,n:: Integer ) = default_Fun (f,d,n,Val{! hasnumargs (f,1 )})
7373
74- Fun (f,d:: Space{ReComp} ,n:: Integer ) where {ReComp} = default_Fun (dynamic (f),d,n)
74+ Fun (f,d:: Space ,n:: Integer ) = default_Fun (dynamic (f),d,n)
7575
7676# the following is to avoid ambiguity
7777# Fun(f::Fun,d) should be equivalent to Fun(x->f(x),d)
@@ -144,12 +144,12 @@ Fun(f::Type, d::Space) = error("Not implemented")
144144
145145
146146# special case constructors
147- zeros (S:: Space ) = Fun (S, zeros (1 ) )
148- zeros (:: Type{T} , S:: Space ) where {T <: Number } = Fun (S,zeros (T,1 ))
147+ zeros (S:: Space ) = zeros (Float64, S )
148+ zeros (T :: Type , S:: Space ) = Fun (S,zeros (T,1 ))
149149
150150# catch all
151- ones (S:: Space ) = Fun (x -> 1.0 , S)
152- ones (:: Type{T} , S:: Space ) where {T <: Number } = Fun (x-> one (T),S)
151+ ones (S:: Space ) = ones (Float64, S)
152+ ones (T :: Type , S:: Space ) = Fun (x-> one (T),S)
153153
154154function Fun (:: typeof (identity), d:: Domain )
155155 cd= canonicaldomain (d)
@@ -169,7 +169,7 @@ Fun(::typeof(identity), S::Space) = Fun(identity,domain(S))
169169Fun (f:: typeof (zero), d:: Space ) = zeros (eltype (domain (d)),d)
170170Fun (f:: typeof (one), d:: Space ) = ones (eltype (domain (d)),d)
171171
172- Fun (f:: Type , d:: Domain ) = Fun (f,Space (d))
172+ # Fun(f::Type, d::Domain) = Fun(f,Space(d))
173173Fun (f, d:: Domain ) = Fun (f,Space (d))
174174
175175
0 commit comments