Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
Public Member Functions | List of all members
mc::domains::HyperRectangle< dim > Class Template Reference

Axis-aligned hyperrectangular domain. More...

#include <hyperrectangle.hpp>

Inheritance diagram for mc::domains::HyperRectangle< dim >:
Collaboration diagram for mc::domains::HyperRectangle< dim >:

Public Member Functions

 HyperRectangle (std::array< double, dim > &dims)
 Construct a hyperrectangle from dimension extents.
 
mc::geom::Bounds< dimgetBounds () const override
 Get the axis-aligned bounding box (coincides with the domain).
 
double getBoxVolume () const override
 Compute the volume of the hyperrectangle.
 
bool isInside (const mc::geom::Point< dim > &point) const override
 Test if a point is inside the hyperrectangle.
 
- Public Member Functions inherited from mc::domains::IntegrationDomain< dim >
virtual ~IntegrationDomain ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

template<size_t dim>
class mc::domains::HyperRectangle< dim >

Axis-aligned hyperrectangular domain.

Template Parameters
dimDimensionality of the space.

Represents a Cartesian box centered at the origin: [-d₁/2, d₁/2] × [-d₂/2, d₂/2] × ... × [-dₙ/2, dₙ/2] where dᵢ is the extent along dimension i.

All containment checks and volume computations run in O(dim) time.

Definition at line 29 of file hyperrectangle.hpp.

Constructor & Destructor Documentation

◆ HyperRectangle()

template<size_t dim>
mc::domains::HyperRectangle< dim >::HyperRectangle ( std::array< double, dim > &  dims)

Construct a hyperrectangle from dimension extents.

Parameters
dimsArray of dimension sizes (extent along each axis). The box is centered at origin with ±dims[i]/2 bounds.

Member Function Documentation

◆ getBounds()

template<size_t dim>
mc::geom::Bounds< dim > mc::domains::HyperRectangle< dim >::getBounds ( ) const
overridevirtual

Get the axis-aligned bounding box (coincides with the domain).

Returns
Bounds [-dims[i]/2, +dims[i]/2] for each dimension i.

Implements mc::domains::IntegrationDomain< dim >.

◆ getBoxVolume()

template<size_t dim>
double mc::domains::HyperRectangle< dim >::getBoxVolume ( ) const
overridevirtual

Compute the volume of the hyperrectangle.

Returns
Product of all dimension extents: ∏ dims[i].

Implements mc::domains::IntegrationDomain< dim >.

◆ isInside()

template<size_t dim>
bool mc::domains::HyperRectangle< dim >::isInside ( const mc::geom::Point< dim > &  point) const
overridevirtual

Test if a point is inside the hyperrectangle.

Parameters
pointQuery point.
Returns
true if |point[i]| ≤ dims[i]/2 for all dimensions; false otherwise.

Implements mc::domains::IntegrationDomain< dim >.


The documentation for this class was generated from the following file: