Skip to content

Commit ea6ba63

Browse files
authored
improve transform/itransform docs (#799)
1 parent 45b443c commit ea6ba63

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/docs.jl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -405,22 +405,18 @@ Defaults to `coefficients(transform(canonicalspace(space),values),canonicalspace
405405
406406
# Examples
407407
```jldoctest
408-
julia> f = x -> x^2;
409-
410-
julia> F = Fun(f, Chebyshev());
408+
julia> F = Fun(x -> x^2, Chebyshev());
411409
412410
julia> coefficients(F)
413411
3-element Vector{Float64}:
414412
0.5
415413
0.0
416414
0.5
417415
418-
julia> v = map(f, points(Chebyshev(), 3));
419-
420-
julia> transform(Chebyshev(), v) ≈ coefficients(F)
416+
julia> transform(Chebyshev(), values(F)) ≈ coefficients(F)
421417
true
422418
423-
julia> v = map(f, points(Chebyshev(), 4));
419+
julia> v = map(F, points(Chebyshev(), 4)); # custom grid
424420
425421
julia> transform(Chebyshev(), v)
426422
4-element Vector{Float64}:
@@ -439,16 +435,13 @@ Transform coefficients back to values. Defaults to using `canonicalspace` as in
439435
440436
# Examples
441437
```jldoctest
442-
julia> v = itransform(Chebyshev(), [0.5, 0, 0.5])
443-
3-element Vector{Float64}:
444-
0.75
445-
0.0
446-
0.75
447-
448-
julia> f = Fun(x->x^2, Chebyshev())
438+
julia> F = Fun(x->x^2, Chebyshev())
449439
Fun(Chebyshev(), [0.5, 0.0, 0.5])
450440
451-
julia> values(f)
441+
julia> itransform(Chebyshev(), coefficients(F)) ≈ values(F)
442+
true
443+
444+
julia> itransform(Chebyshev(), [0.5, 0, 0.5])
452445
3-element Vector{Float64}:
453446
0.75
454447
0.0

0 commit comments

Comments
 (0)