public static IntegrationResult Integrate(
Func<IReadOnlyList<double>, double> function,
IReadOnlyList<Interval> volume,
IntegrationSettings settings
)
Public Shared Function Integrate (
function As Func(Of IReadOnlyList(Of Double), Double),
volume As IReadOnlyList(Of Interval),
settings As IntegrationSettings
) As IntegrationResult
public:
static IntegrationResult^ Integrate(
Func<IReadOnlyList<double>^, double>^ function,
IReadOnlyList<Interval>^ volume,
IntegrationSettings^ settings
)
static member Integrate :
function : Func<IReadOnlyList<float>, float> *
volume : IReadOnlyList<Interval> *
settings : IntegrationSettings -> IntegrationResult
Note that the integration function must not attempt to modify the argument passed to it.
Note that the integration volume must be a hyper-rectangle. You can integrate over regions with more complex boundaries by specifying the integration volume as a bounding hyper-rectangle that encloses your desired integration region, and returing the value 0 for the integrand outside of the desired integration region. For example, to find the volume of a unit d-sphere, you can integrate a function that is 1 inside the unit d-sphere and 0 outside it over the volume [-1,1]d. You can integrate over infinite volumes by specifing volume endpoints of PositiveInfinity and/or NegativeInfinity. Volumes with dimension greater than 15 are not currently supported.
Integrals with hard boundaries (like our hyper-sphere volume problem) typically require more evaluations than integrals of smooth functions to achieve the same accuracy. Integrals with canceling positive and negative contributions also typically require more evaluations than integtrals of purely positive functions.
Numerical multi-dimensional integration is computationally expensive. To make problems more tractable, keep in mind some rules of thumb:
ArgumentException | function, volume, or settings are null, or the dimension of volume is larger than 15. |
NonconvergenceException | The prescribed accuracy could not be achieved with the given evaluation budget. |