Open dlfivefifty opened 7 years ago
I think we can do this but just using Space
s:
function ^{DD<:Segment}(s::PolynomialSpace{DD},k)
d = domain(s)
a,b = d.a,d.b
0 == a && return JacobiWeight(k,0,s)
0 == b && return JacobiWeight(0,k,s)
a < 0 < b && return JacobiWeight(0,k,a..0) ∪ JacobiWeight(k,0,0..b)
return s # 0 is not in the interval
end
Base.sqrt(s::Space) = s^0.5
Unfortunately it's not possible to add a default (::Function)(s::Space) = s
, but I think this can be worked around by using try, catch.
In 0.6 calls like
1./f
no longer fall back to1/f
, as it is broadcasted, and hence currently uses the constructor with the domain off
, regardless of the singularities introduced.Apart from improving the constructor, I think we need an auto-differentiation-like method for determining singularities. This would work something like: