Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
proposal.hpp
Go to the documentation of this file.
1
9#ifndef MONTECARLO_1_PROPOSAL_HPP
10#define MONTECARLO_1_PROPOSAL_HPP
11
12#include <random>
13#include "../geometry.hpp"
14
15namespace mc {
16namespace proposals {
17
18
27template <size_t dim>
29{
30public:
32 virtual ~Proposal() = default;
33
39 // Sample a point according to p(x)
40 virtual mc::geom::Point<dim> sample(std::mt19937& rng) const = 0;
41
49 // Evaluate p(x) (the PDF) at x
50 virtual double pdf(const mc::geom::Point<dim>& x) const = 0;
51};
52
53} // namespace proposals
54} // namespace mc
55
56#endif
N-dimensional point representation.
Definition geometry.hpp:32
Abstract proposal distribution interface.
Definition proposal.hpp:29
virtual double pdf(const mc::geom::Point< dim > &x) const =0
Evaluate the proposal probability density function.
virtual ~Proposal()=default
Virtual destructor for proper cleanup.
virtual mc::geom::Point< dim > sample(std::mt19937 &rng) const =0
Draw a random sample from the proposal distribution.