Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
polytope.hpp
Go to the documentation of this file.
1
9#ifndef MONTECARLO_1_POLYTOPE_H
10#define MONTECARLO_1_POLYTOPE_H
11
13#include "../geometry.hpp"
14#include <vector>
15#include <stdexcept>
16
17namespace mc::domains {
18
33template <size_t dim>
34class PolyTope : public IntegrationDomain<dim> {
35public:
36
48 PolyTope(const std::vector<geom::Point<dim>>& vertices,
49 const std::vector<std::array<double, dim>>& norms,
50 const std::vector<double>& offs);
51
57 geom::Bounds<dim> getBounds() const override;
58
64 double getBoxVolume() const override;
65
73 bool isInside(const geom::Point<dim> &p) const override;
74
75private:
77 std::vector<mc::geom::Point<dim>> vec;
79 std::vector<std::array<double, dim>> normals;
81 std::vector<double> offsets;
82};
83
84} // namespace mc::domains
85
86#include "polytope.tpp"
87
88#endif //MONTECARLO_1_POLYTOPE_H
Abstract base class for N-dimensional integration domains.
Convex polytope (convex polyhedron) integration domain.
Definition polytope.hpp:34
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.
N-dimensional axis-aligned bounding box.
Definition geometry.hpp:70
N-dimensional point representation.
Definition geometry.hpp:32
Abstract interface for N-dimensional integration domains.