Skip to content

Commit 2a55e1a

Browse files
authored
Add docstring for DefiniteIntegral (#475)
1 parent 4be86f3 commit 2a55e1a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Operators/functionals/CalculusFunctional.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ end
6161
DefiniteIntegral(sp::UnsetSpace) = ConcreteDefiniteIntegral(sp)
6262
DefiniteLineIntegral(sp::UnsetSpace) = ConcreteDefiniteLineIntegral(sp)
6363

64+
"""
65+
DefiniteIntegral([sp::Space])
66+
67+
Return the operator that integrates a `Fun` over its domain. If `sp` is unspecified,
68+
it is inferred at runtime from the context.
69+
70+
# Examples
71+
```jldoctest
72+
julia> f = Fun(x -> 3x^2, Chebyshev());
73+
74+
julia> DefiniteIntegral() * f ≈ 2 # integral of 3x^2 over -1..1
75+
true
76+
```
77+
"""
6478
function DefiniteIntegral(sp::Space)
6579
if typeof(canonicaldomain(sp)) == typeof(domain(sp))
6680
# try using `Integral`

0 commit comments

Comments
 (0)