Skip to content

Commit

Permalink
mention quadgk as an alternative to hquadrature
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jul 22, 2017
1 parent 7fafe18 commit c2fece2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ Compute the (1d) integral of f(x) from `a` to `b`. The
return value of `hcubature` is a tuple `(I, E)` of the estimated integral
`I` and an estimated error `E`.

The other parameters are the same as [`hcubature`](@ref). `hquadrature``
The other parameters are the same as `hcubature` (above). `hquadrature``
is just a convenience wrapper around `hcubature` so that you can work
with scalar `x`, `a`, and `b`, rather than 1-component vectors.

Alternatively, for 1d integrals you can import the [QuadGK](https://github.com/JuliaMath/QuadGK.jl) module
and call the [`quadgk`](https://juliamath.github.io/QuadGK.jl/stable/#QuadGK.quadgk) function, which provides additional flexibility
e.g. in choosing the order of the quadrature rule. (`QuadGK` is used
internally anyway by `HCubature` to compute the quadrature rule.)

## Algorithm

The algorithm of `hquadrature` is based on the one described in:
Expand Down
4 changes: 4 additions & 0 deletions src/HCubature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ return value of `hcubature` is a tuple `(I, E)` of the estimated integral
The other parameters are the same as [`hcubature`](@ref). `hquadrature``
is just a convenience wrapper around `hcubature` so that you can work
with scalar `x`, `a`, and `b`, rather than 1-component vectors.
Alternatively, for 1d integrals you can import the [`QuadGK`](@ref) module
and call the [`quadgk`](@ref) function, which provides additional flexibility
e.g. in choosing the order of the quadrature rule.
"""
hquadrature(f, a, b; norm=vecnorm, rtol::Real=0, atol::Real=0,
maxevals::Integer=typemax(Int)) =
Expand Down

0 comments on commit c2fece2

Please sign in to comment.