Skip to content

Commit 1b8473f

Browse files
authored
Don't display intervals (#898)
* don't display intervals * skip manuals in doctest
1 parent b26907b commit 1b8473f

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

docs/src/usage/constructors.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,32 @@ end
88

99
`Fun`s in ApproxFun are instances of Julia types with one field to store coefficients and another to describe the function space. Similarly, each function space has one field describing its domain, or another function space. Let's explore:
1010

11-
```jldoctest
11+
```jldoctest Fun
1212
julia> x = Fun(identity,-1..1);
1313
1414
julia> f = exp(x);
1515
16-
julia> g = f/sqrt(1-x^2);
16+
julia> space(f) == Chebyshev(-1..1)
17+
true
18+
```
19+
In this example, `f` is a `Fun` that corresponds to a Chebyshev interpolant to `exp(x)`, and evaluating `f(x)` will generate a close approximation to `exp(x)`. In this case, the space is automatically inferred from the domain.
1720

18-
julia> space(f) # Output is pretty version of Chebyshev(Interval(-1.0,1.0))
19-
Chebyshev(-1 .. 1)
21+
`Fun`s may also incorporate singularities at the edges of the domain. In such cases, if the variable is in a polynomial space, the resulting space is a [`JacobiWeight`](@ref), which factors out the singularity and interpolates the residual analytical component. Perhaps this is best illustrated through an example:
22+
```jldoctest Fun
23+
julia> g = f/sqrt(1-x^2);
2024
21-
julia> space(g) # Output is pretty version of JacobiWeight(-0.5, -0.5, -1..1)
22-
(1-x^2)^-0.5[Chebyshev(-1 .. 1)]
25+
julia> space(g) == JacobiWeight(-0.5, -0.5, Chebyshev(-1..1))
26+
true
2327
```
28+
The function `g` in this case is expanded the basis ``(1-x^2)^{1/2}\;T_n(x)``, where ``T_n(x)`` are Chebyshev polynomials. This is equivalent to expanding the function `f` in a Chebyshev basis.
2429

2530
The absolute value is another case where the space of the output is inferred from the operation:
2631

2732
```jldoctest abs_space
28-
julia> f = Fun(x->cospi(5x),-1..1);
33+
julia> f = Fun(x->cospi(5x), -1..1);
2934
3035
julia> g = abs(f);
3136
32-
julia> space(f)
33-
Chebyshev(-1 .. 1)
34-
3537
julia> space(g) isa ContinuousSpace # Piecewise continous functions
3638
true
3739
@@ -43,7 +45,7 @@ that of continuous functions over the piecewise domain:
4345
```jldoctest abs_space
4446
julia> p = [-1; roots(f); 1];
4547
46-
julia> segments = @views [Segment(x,y) for (x,y) in zip(p[1:end-1], p[2:end])];
48+
julia> segments = [Segment(x,y) for (x,y) in zip(p[1:end-1], p[2:end])];
4749
4850
julia> components(domain(g)) == segments
4951
true

docs/src/usage/spaces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,13 @@ and the basis becomes
148148

149149
`SumSpace((space_1,space_2,…,space_n))` represents the direct sum of the spaces, where evaluation is defined by adding up each component. A simple example is the following, showing that the coefficients are stored by interlacing:
150150

151-
```jldoctest
151+
```jldoctest sumspace
152152
julia> x = Fun(identity, -1..1);
153153
154154
julia> f = cos(x-0.1)*sqrt(1-x^2) + exp(x);
155155
156-
julia> space(f) # isa SumSpace
157-
(1-x^2)^0.5[Chebyshev(-1 .. 1)] ⊕ Chebyshev(-1 .. 1)
156+
julia> space(f) == JacobiWeight(0.5, 0.5, Chebyshev(-1..1)) + Chebyshev(-1..1)
157+
true
158158
159159
julia> a, b = components(f);
160160

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ DocMeta.setdocmeta!(ApproxFunBase, :DocTestSetup, :(using ApproxFun); recursive=
2323
DocMeta.setdocmeta!(ApproxFun, :DocTestSetup, :(using ApproxFun); recursive=true)
2424

2525
@testset "doctests" begin
26-
doctest(ApproxFun)
26+
doctest(ApproxFun, manual=false)
2727
doctest(ApproxFunBase, manual=false)
2828
end
2929

0 commit comments

Comments
 (0)