diff --git a/docs/src/basics/SampledIntegralProblem.md b/docs/src/basics/SampledIntegralProblem.md index f856c68..52847b2 100644 --- a/docs/src/basics/SampledIntegralProblem.md +++ b/docs/src/basics/SampledIntegralProblem.md @@ -24,7 +24,7 @@ method = TrapezoidalRule() solve(problem, method) ``` -The exact answer is of course \$ 1/3 \$. +The exact answer is of course ``1/3``. ## Details diff --git a/docs/src/tutorials/numerical_integrals.md b/docs/src/tutorials/numerical_integrals.md index 35ccf42..8affe5c 100644 --- a/docs/src/tutorials/numerical_integrals.md +++ b/docs/src/tutorials/numerical_integrals.md @@ -125,7 +125,7 @@ For example, we can create our own sine function by integrating the cosine funct using Integrals my_sin(x) = solve(IntegralProblem((x, p) -> cos(x), (0.0, x)), QuadGKJL()).u x = 0:0.1:(2 * pi) -@. my_sin(x) ≈ sin(x) +all(@. my_sin(x) ≈ sin(x)) ``` ## Infinity handling diff --git a/src/algorithms.jl b/src/algorithms.jl index bbffa12..f12865c 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -12,6 +12,7 @@ allocate the buffer as this is handled automatically. ## References +```tex @article{laurie1997calculation, title={Calculation of Gauss-Kronrod quadrature rules}, author={Laurie, Dirk}, @@ -21,6 +22,7 @@ number={219}, pages={1133--1145}, year={1997} } +``` """ struct QuadGKJL{F, B} <: SciMLBase.AbstractIntegralAlgorithm order::Int @@ -44,6 +46,7 @@ you do not allocate the buffer as this is handled automatically. ## References +```tex @article{genz1980remarks, title={Remarks on algorithm 006: An adaptive algorithm for numerical integration over an N-dimensional rectangular region}, author={Genz, Alan C and Malik, Aftab Ahmad}, @@ -54,6 +57,7 @@ pages={295--302}, year={1980}, publisher={Elsevier} } +``` """ struct HCubatureJL{F, B} <: SciMLBase.AbstractIntegralAlgorithm initdiv::Int @@ -81,6 +85,7 @@ This algorithm can only integrate `Float64`-valued functions ## References +```tex @article{lepage1978new, title={A new algorithm for adaptive multidimensional integration}, author={Lepage, G Peter}, @@ -91,6 +96,7 @@ pages={192--203}, year={1978}, publisher={Elsevier} } +``` """ struct VEGAS{S} <: SciMLBase.AbstractIntegralAlgorithm nbins::Int @@ -143,7 +149,7 @@ function GaussLegendre(; n = 250, subintervals = 1, nodes = nothing, weights = n end """ -QuadratureRule(q; n=250) + QuadratureRule(q; n=250) Algorithm to construct and evaluate a quadrature rule `q` of `n` points computed from the inputs as `x, w = q(n)`. It assumes the nodes and weights are for the standard interval diff --git a/src/algorithms_extension.jl b/src/algorithms_extension.jl index a056c57..901f540 100644 --- a/src/algorithms_extension.jl +++ b/src/algorithms_extension.jl @@ -13,6 +13,7 @@ Importance sampling is used to reduce variance. ## References +```tex @article{lepage1978new, title={A new algorithm for adaptive multidimensional integration}, author={Lepage, G Peter}, @@ -23,6 +24,7 @@ pages={192--203}, year={1978}, publisher={Elsevier} } +``` """ struct CubaVegas <: AbstractCubaAlgorithm flags::Int @@ -42,6 +44,7 @@ Importance sampling and subdivision are thus used to reduce variance. ## References +```tex @article{hahn2005cuba, title={Cuba—a library for multidimensional numerical integration}, author={Hahn, Thomas}, @@ -52,6 +55,7 @@ pages={78--95}, year={2005}, publisher={Elsevier} } +``` """ struct CubaSUAVE{R} <: AbstractCubaAlgorithm where {R <: Real} flags::Int @@ -70,6 +74,7 @@ Stratified sampling is used to reduce variance. ## References +```tex @article{friedman1981nested, title={A nested partitioning procedure for numerical multiple integration}, author={Friedman, Jerome H and Wright, Margaret H}, @@ -80,6 +85,7 @@ pages={76--92}, year={1981}, publisher={ACM New York, NY, USA} } +``` """ struct CubaDivonne{R1, R2, R3, R4} <: AbstractCubaAlgorithm where {R1 <: Real, R2 <: Real, R3 <: Real, R4 <: Real} @@ -105,6 +111,7 @@ Multidimensional h-adaptive integration from Cuba.jl. ## References +```tex @article{berntsen1991adaptive, title={An adaptive algorithm for the approximate calculation of multiple integrals}, author={Berntsen, Jarle and Espelid, Terje O and Genz, Alan}, @@ -115,6 +122,7 @@ pages={437--451}, year={1991}, publisher={ACM New York, NY, USA} } +``` """ struct CubaCuhre <: AbstractCubaAlgorithm flags::Int @@ -165,6 +173,7 @@ Defaults to `Cubature.INDIVIDUAL`, other options are ## References +```tex @article{genz1980remarks, title={Remarks on algorithm 006: An adaptive algorithm for numerical integration over an N-dimensional rectangular region}, author={Genz, Alan C and Malik, Aftab Ahmad}, @@ -175,6 +184,7 @@ pages={295--302}, year={1980}, publisher={Elsevier} } +``` """ struct CubatureJLh <: AbstractCubatureJLAlgorithm error_norm::Int32 diff --git a/src/algorithms_sampled.jl b/src/algorithms_sampled.jl index 9e71237..bc1085f 100644 --- a/src/algorithms_sampled.jl +++ b/src/algorithms_sampled.jl @@ -7,7 +7,7 @@ Struct for evaluating an integral via the trapezoidal rule. Example with sampled data: -``` +```julia using Integrals f = x -> x^2 x = range(0, 1, length=20) @@ -28,7 +28,7 @@ Simpson's composite 1/3 rule for non-equidistant grids. Example with equidistant data: -``` +```julia using Integrals f = x -> x^2 x = range(0, 1, length=20)