quadrature.jl-67601950-bd08-11e9-3c89-fd23fb4432d2
Last mirrored from https://github.com/JuliaDiffEq/Quadrature.jl.git on 2019-11-19T04:15:28.134-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.32 , triggered by Travis cron job on branch "master"
https://github.com/unofficialjuliamirror/quadrature.jl-67601950-bd08-11e9-3c89-fd23fb4432d2
Science Score: 18.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Repository
Last mirrored from https://github.com/JuliaDiffEq/Quadrature.jl.git on 2019-11-19T04:15:28.134-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.32 , triggered by Travis cron job on branch "master"
Basic Info
- Host: GitHub
- Owner: UnofficialJuliaMirror
- License: mit
- Language: Julia
- Default Branch: master
- Size: 14.6 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Quadrature.jl
Quadrature.jl is an instantiation of the DiffEqBase.jl common QuadratureProblem
interface for the common quadrature packages of Julia. By using Quadrature.jl,
you get a single predictable interface where many of the arguments are
standardized throughout the various integrator libraries. This can be useful
for benchmarking or for library implementations, since libraries which internally
use a quadrature can easily accept a quadrature method as an argument.
Examples
For basic multidimensional quadrature we can construct and solve a QuadratureProblem:
julia
using Quadrature
f(x,p) = sum(sin.(x))
prob = QuadratureProblem(f,ones(2),3ones(2))
sol = solve(prob,HCubatureJL(),reltol=1e-3,abstol=1e-3)
If we would like to parallelize the computation, we can use the batch interface to compute multiple points at once. For example, here we do allocation-free multithreading with Cubature.jl:
julia
using Quadrature, Cubature, Base.Threads
function f(dx,x,p)
Threads.@threads for i in 1:size(x,2)
dx[i] = sum(sin.(@view(x[:,i])))
end
end
prob = QuadratureProblem(f,ones(2),3ones(2),batch=2)
sol = solve(prob,CubatureJLh(),reltol=1e-3,abstol=1e-3)
If we would like to compare the results against Cuba.jl's Cuhre method, then
the change is one argument change:
julia
using Cuba
sol = solve(prob,CubaCuhre(),reltol=1e-3,abstol=1e-3)
QuadratureProblem
To use this package, you always construct a QuadratureProblem. This has a
constructor:
julia
QuadratureProblem(f,lb,ub,p=NullParameters();
nout=1, batch = 0, kwargs...)
f: Either a functionf(x,p)for out-of-place orf(dx,x,p)for in place.lb: Either a number or vector of lower boundsub: Either a number or vector of upper boundsp: The parameters associated with the problemnout: The output size of the functionf. Defaults to1, i.e. a scalar integral output.batch: The preferred number of points to batch. This allows user-side parallelization of the integrand. Ifbatch != 0, then eachx[:,i]is a different point of the integral to calculate, and the output should benout x batchsize. Note thatbatchis a suggestion for the number of points, and it is not necessarily true thatbatchis the same asbatchsizein all algorithms.
Additionally, we can supply iip like QuadratureProblem{iip}(...) as true or
false to declare at compile time whether the integrator function is in-place.
Algorithms
The following algorithms are available:
QuadGKJL: Uses QuadGK.jl. Requiresnout=1andbatch=0.HCubatureJL: Uses HCubature.jl. Requiresbatch=0.VEGAS: Uses MonteCarloIntegration.jl. Requiresnout=1.CubatureJLh: h-Cubature from Cubature.jl. Requiresusing Cubature.CubatureJLp: p-Cubature from Cubature.jl. Requiresusing Cubature.CubaVegas: Vegas from Cuba.jl.CubaSUAVE: SUAVE from Cuba.jl.CubaDivonne: Divonne from Cuba.jl.CubaCuhre: Cuhre from Cuba.jl
Common Solve Keyword Arguments
reltol: Relative toleranceabstol: Absolute tolerancemaxiters: The maximum number of iterations
Additionally, the extra keyword arguments are splatted to the library calls, so see the documentation of the integrator library for all of the extra details. These extra keyword arguments are not guaranteed to act uniformly.
Owner
- Name: Unofficial Julia Mirror
- Login: UnofficialJuliaMirror
- Kind: organization
- Website: https://github.com/UnofficialJuliaMirror/MirrorUpdater.jl
- Repositories: 3
- Profile: https://github.com/UnofficialJuliaMirror
Mirror of all registered Julia packages. Updated weekly by @UnofficialJuliaMirrorBot. See also: @UnofficialJuliaMirrorSnapshots.
Citation (CITATION.bib)
@article{DifferentialEquations.jl-2017,
author = {Rackauckas, Christopher and Nie, Qing},
doi = {10.5334/jors.151},
journal = {The Journal of Open Source Software},
keywords = {Applied Mathematics},
note = {Exported from https://app.dimensions.ai on 2019/05/05},
number = {1},
pages = {},
title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
volume = {5},
year = {2017}
}