This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / integrate / _rules / _genz_malik / GenzMalikCubature

class

scipy.integrate._rules._genz_malik:GenzMalikCubature

source: build-install/usr/lib/python3.14/site-packages/scipy/integrate/_rules/_genz_malik.py:12

Signature

class GenzMalikCubature(ndim, degree = 7, lower_degree = 5)

Members

Summary

Genz-Malik cubature.

Extended Summary

Genz-Malik is only defined for integrals of dimension >= 2.

Parameters

ndim : int

The spatial dimension of the integrand.

Attributes

higher : Cubature

Higher-order rule.

lower : Cubature

Lower-order rule.

Examples

Evaluate a 3D integral:
import numpy as np
from scipy.integrate import cubature
from scipy.integrate._rules import GenzMalikCubature
def f(x):
    # f(x) = cos(x_1) + cos(x_2) + cos(x_3)
    return np.sum(np.cos(x), axis=-1)
rule = GenzMalikCubature(3) # Use 3D Genz-Malik
a, b = np.array([0, 0, 0]), np.array([1, 1, 1])
✓
rule.estimate(f, a, b) # True value 3*sin(1), approximately 2.5244
rule.estimate_error(f, a, b)
✗
np.int64(2)

Aliases

  • scipy.integrate._cubature.GenzMalikCubature