@@ -270,13 +270,13 @@ Return the domain that `f` is defined on.
270
270
```jldoctest
271
271
julia> f = Fun(x->x^2);
272
272
273
- julia> domain(f)
274
- -1.0..1.0 (Chebyshev)
273
+ julia> domain(f) == ChebyshevInterval()
274
+ true
275
275
276
276
julia> f = Fun(x->x^2, 0..1);
277
277
278
- julia> domain(f)
279
- 0..1
278
+ julia> domain(f) == 0..1
279
+ true
280
280
```
281
281
"""
282
282
domain (f:: Fun ) = domain (f. space)
@@ -293,14 +293,21 @@ Return `f` projected onto `domain`.
293
293
294
294
# Examples
295
295
```jldoctest
296
- julia> f = Fun(x->x^2)
297
- Fun(Chebyshev(), [0.5, 0.0, 0.5])
296
+ julia> f = Fun(x->x^2);
297
+
298
+ julia> domain(f) == ChebyshevInterval()
299
+ true
298
300
299
- julia> setdomain(f, 0..1)
300
- Fun(Chebyshev(0..1), [0.5, 0.0, 0.5])
301
+ julia> g = setdomain(f, 0..1);
302
+
303
+ julia> domain(g) == 0..1
304
+ true
305
+
306
+ julia> coefficients(f) == coefficients(g)
307
+ true
301
308
```
302
309
"""
303
- setdomain (f:: Fun ,d:: Domain ) = Fun (setdomain (space (f),d),f. coefficients)
310
+ setdomain (f:: Fun , d:: Domain ) = Fun (setdomain (space (f), d), f. coefficients)
304
311
305
312
for op in (:tocanonical ,:tocanonicalD ,:fromcanonical ,:fromcanonicalD ,:invfromcanonicalD )
306
313
@eval $ op (f:: Fun ,x... ) = $ op (space (f),x... )
@@ -385,10 +392,7 @@ Return an extrapolation of `f` from its domain to `x`.
385
392
julia> f = Fun(x->x^2)
386
393
Fun(Chebyshev(), [0.5, 0.0, 0.5])
387
394
388
- julia> domain(f)
389
- -1.0..1.0 (Chebyshev)
390
-
391
- julia> extrapolate(f, 2)
395
+ julia> extrapolate(f, 2) # 2 lies outside the domain -1..1
392
396
4.0
393
397
```
394
398
"""
@@ -422,6 +426,7 @@ values(f::Fun,dat...) = _values(f.space, f.coefficients, dat...)
422
426
_values (sp, v, dat... ) = itransform (sp, v, dat... )
423
427
_values (sp:: UnivariateSpace , v:: Vector{T} , dat... ) where {T<: Number } =
424
428
itransform (sp, v, dat... ):: Vector{float(T)}
429
+
425
430
"""
426
431
points(f::Fun)
427
432
0 commit comments