|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Convex polytope (convex polyhedron) integration domain. More...
#include <polytope.hpp>
Public Member Functions | |
| PolyTope (const std::vector< geom::Point< dim > > &vertices, const std::vector< std::array< double, dim > > &norms, const std::vector< double > &offs) | |
| Construct a polytope from vertices and facet constraints. | |
| geom::Bounds< dim > | getBounds () const override |
| Get the axis-aligned bounding box containing the polytope. | |
| double | getBoxVolume () const override |
| Get the volume of the axis-aligned bounding box. | |
| bool | isInside (const geom::Point< dim > &p) const override |
| Test if a point is inside or on the boundary of the polytope. | |
Public Member Functions inherited from mc::domains::IntegrationDomain< dim > | |
| virtual | ~IntegrationDomain ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Convex polytope (convex polyhedron) integration domain.
| dim | The dimensionality of the space. |
A polytope is the intersection of half-spaces defined by linear inequalities: normal_i · point + offset_i ≤ 0 for all facets i
where normal_i is an inward-pointing unit normal and offset_i is the constant term. This representation supports arbitrary convex polytopes with any number of facets.
Definition at line 34 of file polytope.hpp.
| mc::domains::PolyTope< dim >::PolyTope | ( | const std::vector< geom::Point< dim > > & | vertices, |
| const std::vector< std::array< double, dim > > & | norms, | ||
| const std::vector< double > & | offs | ||
| ) |
Construct a polytope from vertices and facet constraints.
| vertices | Vector of vertices (corners) of the polytope. Used only for computing the bounding box. |
| norms | Vector of inward-pointing normal vectors; one per facet. Each normal is an array of dim coefficients. |
| offs | Vector of offset values (constant terms); one per facet. |
| std::runtime_error | if norms and offs have different sizes, or if vertices is empty. |
|
overridevirtual |
Get the axis-aligned bounding box containing the polytope.
Implements mc::domains::IntegrationDomain< dim >.
|
overridevirtual |
Get the volume of the axis-aligned bounding box.
Used for Monte Carlo weight normalization in sampling.
Implements mc::domains::IntegrationDomain< dim >.
|
overridevirtual |
Test if a point is inside or on the boundary of the polytope.
| p | The point to test. |
Implements mc::domains::IntegrationDomain< dim >.