mintegrated

(Multi)dimensional integration using the MISER algorithm.


Keywords
library, scientific, numeric
License
Apache-2.0
Install
dub fetch mintegrated --version 0.2.1

Documentation

Mintegrated Build Status

Library for (multi)dimensional integration written in D. Currently limited to an implementation of the MISER algorithm

unittest
{
    import std.math : PI, pow;
    import std.stdio : writeln;
    auto func = function( double[] xs )
    {
        if (pow(xs[0],2)+pow(xs[1],2)<= 1.0)
            return 1.0;
        return 0.0;
    };

    auto result = integrate( func, [-1.0,-1], [1.0,1.0], 1e-5, 1e-7 );
    result.writeln;
    assert( result.value <= PI + 1e-3 );
    assert( result.value >= PI - 1e-3 );
}