Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
hypercylinder.hpp
Go to the documentation of this file.
1
8#ifndef MONTECARLO_1_HYPERCYLINDER_HPP
9#define MONTECARLO_1_HYPERCYLINDER_HPP
10
12#include "../geometry.hpp"
13#include <cmath>
14
15namespace mc::domains {
16
27template <size_t dim>
28class HyperCylinder : public IntegrationDomain<dim> {
29public:
36 HyperCylinder(double rad, double h);
37
43 geom::Bounds<dim> getBounds() const override;
44
50 double getBoxVolume() const override;
51
58 bool isInside(const geom::Point<dim> &p) const override;
59
60private:
62 double radius;
64 double height;
65};
66
67// Ensure the implementation code is saved as "hypercylinder.tpp"
68
69} // namespace mc::domains
70
71#include "hypercylinder.tpp"
72
73#endif //MONTECARLO_1_HYPERCYLINDER_HPP
N-dimensional hypercylinder.
geom::Bounds< dim > getBounds() const override
Get the axis-aligned bounding box (hypercube).
HyperCylinder(double rad, double h)
Construct a hypercylinder with given base radius and height.
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.
Abstract base class for N-dimensional integration domains.
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.