diff --git a/docs/logo.jl b/docs/logo.jl new file mode 100644 index 0000000..0b4f7c4 --- /dev/null +++ b/docs/logo.jl @@ -0,0 +1,54 @@ +using FastGaussQuadrature, LinearAlgebra, Luxor +logocolors = Luxor.Colors.JULIA_LOGO_COLORS + +@svg begin + n = 15 + Drawing(500,500, "docs/src/assets/logo.svg") + origin() + unitlength = 210 + translate(0, unitlength) + + Y = (n+1/2)/π + + x_lgd, w_lgd = gausslegendre(n) + x_cbs, w_cbs = gausschebyshev(n,3) + x_jcb, w_jcb = gaussjacobi(n,5/2,1/2) + + c_lgd = logocolors[1] # Red + c_cbs = logocolors[2] # Green + c_jcb = logocolors[4] # Purple + + p_jcb = [Point(unitlength*x_jcb[i], -Y*unitlength*w_jcb[i]) for i in 1:n] + p_cbs = [Point(unitlength*x_cbs[i], -Y*unitlength*w_cbs[i]) for i in 1:n] + p_lgd = [Point(unitlength*x_lgd[i], -Y*unitlength*w_lgd[i]) for i in 1:n] + + l_jcb = [norm(p_jcb[i+1]-p_jcb[i]) for i in 1:n-1] + l_cbs = [norm(p_cbs[i+1]-p_cbs[i]) for i in 1:n-1] + l_lgd = [norm(p_lgd[i+1]-p_lgd[i]) for i in 1:n-1] + + r_jcb = zeros(n) + r_cbs = zeros(n) + r_lgd = zeros(n) + + r_jcb[end] = norm(l_jcb[end])/2 * 0.8 + r_cbs[end] = norm(l_cbs[end])/2 * 0.7 + r_lgd[end] = norm(l_lgd[end])/2 * 0.75 + + for i in reverse(1:n-1) r_jcb[i] = l_jcb[i] - r_jcb[i+1] end + for i in reverse(1:n-1) r_cbs[i] = l_cbs[i] - r_cbs[i+1] end + for i in reverse(1:n-1) r_lgd[i] = l_lgd[i] - r_lgd[i+1] end + + sethue(c_cbs) + for i in 5:n circle(p_cbs[i], r_cbs[i], :fill) end + sethue(c_jcb) + for i in 1:n circle(p_jcb[i], r_jcb[i], :fill) end + sethue(c_lgd) + for i in 1:n circle(p_lgd[i], r_lgd[i], :fill) end + sethue(c_cbs) + for i in 1:4 circle(p_cbs[i], r_cbs[i], :fill) end + + finish() + preview() +end + +run(`convert -density 256x256 -background transparent docs/src/assets/logo.svg -define icon:auto-resize -colors 256 docs/src/assets/favicon.ico`) diff --git a/docs/make.jl b/docs/make.jl index e1e558a..1387079 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,6 +12,7 @@ makedocs(; "Gaussian Quadrature" => "gaussquadrature.md", "Benchmark" => "benchmark.md", "Roots of Bessel function" => "besselroots.md", + "Misc." => "misc.md", "References" => "reference.md", ], repo = "https://github.com/JuliaApproximation/FastGaussQuadrature.jl/blob/{commit}{path}#L{line}", diff --git a/docs/src/assets/favicon.ico b/docs/src/assets/favicon.ico new file mode 100644 index 0000000..d483736 Binary files /dev/null and b/docs/src/assets/favicon.ico differ diff --git a/docs/src/assets/logo.svg b/docs/src/assets/logo.svg new file mode 100644 index 0000000..e7fade6 --- /dev/null +++ b/docs/src/assets/logo.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/misc.md b/docs/src/misc.md new file mode 100644 index 0000000..5a7d222 --- /dev/null +++ b/docs/src/misc.md @@ -0,0 +1,21 @@ +# Misc. + +## About the logo +![](assets/logo.svg) + +* The center points of circles are generated from nodes(x-axis) and weights(y-axis) of Gaussian quadrature. + * Number of points : `n = 15` + * ``\textcolor{#CB3C33}{\text{\textbf{Red}}}`` : `gausslegendre(n)` + * ``\textcolor{#389826}{\text{\textbf{Green}}}`` : `gausschebyshev(n, 3)` + * ``\textcolor{#9558B2}{\text{\textbf{Purple}}}`` : `gaussjacobi(n, 5/2, 1/2)` +* These colors are from [julia-logo-graphics](https://github.com/JuliaLang/julia-logo-graphics). +* The logo is generated with [Luxor.jl](https://github.com/JuliaGraphics/Luxor.jl), and its source code is [here](https://github.com/JuliaApproximation/FastGaussQuadrature.jl/blob/master/docs/logo.jl). + + +## Other docstrings from private methods + +```@autodocs +Modules = [FastGaussQuadrature] +Private = true +Public = false +``` diff --git a/src/gaussjacobi.jl b/src/gaussjacobi.jl index d8a2012..36cfa33 100644 --- a/src/gaussjacobi.jl +++ b/src/gaussjacobi.jl @@ -253,7 +253,7 @@ end """ Evaluate the interior asymptotic formula at x = cos(t). Assumption: -* length(t) == n ÷ 2 +* `length(t) == n ÷ 2` """ function feval_asy1(n::Integer, α::Float64, β::Float64, t::AbstractVector, idx) # Number of terms in the expansion: diff --git a/src/gausslaguerre.jl b/src/gausslaguerre.jl index 8ae35b9..7f9a365 100644 --- a/src/gausslaguerre.jl +++ b/src/gausslaguerre.jl @@ -106,16 +106,11 @@ const airy_roots = [-2.338107410459767, -4.08794944413097, -5.520559828095551, """ -Compute the Gauss-Laguerre rule using explicit asymptotic expansions for the nodes -and weights. +Compute the Gauss-Laguerre rule using explicit asymptotic expansions for the nodes and weights. Optional parameters are: -- `reduced`: compute a reduced quadrature rule, discarding all points and weights -as soon as the weights underflow -- `T`: the order of the expansion. Set `T=-1` to determine the order adaptively -depending on the size of the terms in the expansion -- `recompute`: if a crude measure of the error is larger than a tolerance, -the point and weight are recomputed using the (slower) recursion+newton approach, -yielding more reliable accurate results. +- `reduced`: compute a reduced quadrature rule, discarding all points and weights as soon as the weights underflow +- `T`: the order of the expansion. Set `T=-1` to determine the order adaptively depending on the size of the terms in the expansion +- `recompute`: if a crude measure of the error is larger than a tolerance, the point and weight are recomputed using the (slower) recursion+newton approach, yielding more reliable accurate results. """ function gausslaguerre_asy(n::Integer, α; reduced = false,