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::HyperCylinder< dim > Class Template Reference

N-dimensional hypercylinder. More...

#include <hypercylinder.hpp>

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

Public Member Functions

 HyperCylinder (double rad, double h)
 Construct a hypercylinder with given base radius and height.
 
geom::Bounds< dimgetBounds () const override
 Get the axis-aligned bounding box (hypercube).
 
double getBoxVolume () const override
 Get the volume of the bounding box.
 
bool isInside (const geom::Point< dim > &p) const override
 Test if a point is inside the hypercylinder.
 
- 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::HyperCylinder< dim >

N-dimensional hypercylinder.

Template Parameters
dimDimensionality (e.g., 2 for annulus, 3 for cylinder, N for hypercylinder).

Represents a solid hypercylinder defined as an (N-1)-dimensional hypersphere of radius r extended (extruded) along the last dimension by height h: C = {x ∈ ℝⁿ : x₁² + ... + x_{n-1}² ≤ r², 0 ≤ xₙ ≤ h}

Bounding box: [-r, r]^(N-1) × [0, h].

Definition at line 28 of file hypercylinder.hpp.

Constructor & Destructor Documentation

◆ HyperCylinder()

template<size_t dim>
mc::domains::HyperCylinder< dim >::HyperCylinder ( double  rad,
double  h 
)

Construct a hypercylinder with given base radius and height.

Parameters
radRadius of the (N-1)-dimensional hypersphere base (must be > 0).
hHeight along the last dimension (must be ≥ 0).
Note
Requires dim ≥ 2.

Member Function Documentation

◆ getBounds()

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

Get the axis-aligned bounding box (hypercube).

Returns
Bounds [-radius, radius] for first N-1 dimensions, and [0, height] for the last dimension.

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

◆ getBoxVolume()

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

Get the volume of the bounding box.

Returns
(2*radius)^(dim-1) * height

Used for Monte Carlo weight normalization in sampling.

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

◆ isInside()

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

Test if a point is inside the hypercylinder.

Parameters
pPoint to test.
Returns
true if radial distance² ≤ radius² AND 0 ≤ p[last] ≤ height; false otherwise.

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


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