From 8cb696e5950b8133117b360fc68be0b4aedbb650 Mon Sep 17 00:00:00 2001 From: Abhro R <5664668+abhro@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:56:29 -0400 Subject: [PATCH 1/5] Indent constructor header --- src/algorithms.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms.jl b/src/algorithms.jl index bbffa12..d7fdd32 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -143,7 +143,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 From 331ec2f9d10f0f51e478e35556543fe2b09c272c Mon Sep 17 00:00:00 2001 From: Abhro R <5664668+abhro@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:56:45 -0400 Subject: [PATCH 2/5] Use all() in example block A `true` will provide more info than a truncated representation of a 63-BitVector. --- docs/src/tutorials/numerical_integrals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3a759e9fc49178d3f376252b1fc6b626c0282e70 Mon Sep 17 00:00:00 2001 From: Abhro R <5664668+abhro@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:58:04 -0400 Subject: [PATCH 3/5] Fix (La/Ka)TeX math formatting --- docs/src/basics/SampledIntegralProblem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 6d09028bbd9996328a1bab751d4b1d2c1de2649b Mon Sep 17 00:00:00 2001 From: Abhro R <5664668+abhro@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:58:37 -0400 Subject: [PATCH 4/5] Add syntax highlighting tag to fenced code blocks --- src/algorithms_sampled.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From ffa4683fa23f375fe1c47e8d6e3a9f60dce769d3 Mon Sep 17 00:00:00 2001 From: Abhro R <5664668+abhro@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:58:59 -0400 Subject: [PATCH 5/5] Fence in BibTeX sections in docstrings BibTeX syntax is more easily viewed in monospace. Moreover, these blocks are more likely to be copied for use in users' .bib files. --- src/algorithms.jl | 6 ++++++ src/algorithms_extension.jl | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/algorithms.jl b/src/algorithms.jl index d7fdd32..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 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