/
Integral.jl
57 lines (42 loc) · 1.22 KB
/
Integral.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
The base type of a fractional integral sense, in FractionalCalculus.jl, all of the fractional integral senses belong to ```FracIntAlg```
"""
abstract type FracIntAlg end
include("RL.jl")
include("Hadamard.jl")
include("SymbolicInt.jl")
"""
fracint(f, α, point, h, FracIntAlg())
The general function used for fractional integral computing.
### Example
```julia-repl
julia> fracint(x->x^2, 0.5, 1, 0.001, RLInt_Approx())
0.6017877646029814
```
There are many algorithms can be used to computing fractional integral, please refer to our manual for more details: [manual](http://scifracx.org/FractionalCalculus.jl/dev/Integral/integralapi/).
"""
function fracint(f, α, point, h, ::FracIntAlg)
end
## Macros for convenient computing.
"""
@fracint(f, α, point)
Return the α-order integral of ``f`` at specific point.
```julia-repl
julia> @fracint(x->x, 0.5, 1)
0.7522525439593486
```
"""
macro fracint(f, α, point)
return :(fracint($f, $α, $point, 0.0001, RLIntApprox()))
end
"""
@semifracint(f, point)
Return the semi-integral of ``f`` at specific point.
```julia-repl
julia> @semifracint(x->x, 1)
0.7522525439593486
```
"""
macro semifracint(f, point)
return :(fracint($f, 0.5, $point, 0.0001, RLIntApprox()))
end