|
limes 3.1.0
Composable Calculus Expressions for C++20
|
Monte Carlo integration using random sampling. Error decreases as O(1/sqrt(n)). More...
#include <methods.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | monte_carlo (std::size_t n, std::optional< std::size_t > s=std::nullopt) noexcept |
| algorithms::integration_result< T > | operator() (std::function< T(T)> const &f, T a, T b) const |
| constexpr monte_carlo | with_seed (std::size_t s) const noexcept |
| constexpr monte_carlo | with_samples (std::size_t n) const noexcept |
Public Attributes | |
| std::size_t | samples |
| std::optional< std::size_t > | seed |
Monte Carlo integration using random sampling. Error decreases as O(1/sqrt(n)).
Definition at line 107 of file methods.hpp.
| using limes::methods::monte_carlo< T >::value_type = T |
Definition at line 108 of file methods.hpp.
|
inlineconstexprnoexcept |
Definition at line 113 of file methods.hpp.
|
inline |
Definition at line 117 of file methods.hpp.
References limes::methods::monte_carlo< T >::samples, limes::methods::monte_carlo< T >::seed, and limes::algorithms::integration_result< T >::variance_.
|
inlineconstexprnoexcept |
Definition at line 152 of file methods.hpp.
References limes::methods::monte_carlo< T >::seed.
|
inlineconstexprnoexcept |
Definition at line 148 of file methods.hpp.
References limes::methods::monte_carlo< T >::samples.
| std::size_t limes::methods::monte_carlo< T >::samples |
Definition at line 110 of file methods.hpp.
Referenced by limes::expr::BoxIntegral< E, Dims >::eval(), limes::expr::ConstrainedBoxIntegral< E, Dims, Constraint >::eval(), limes::methods::monte_carlo< T >::operator()(), and limes::methods::monte_carlo< T >::with_seed().
| std::optional<std::size_t> limes::methods::monte_carlo< T >::seed |
Definition at line 111 of file methods.hpp.
Referenced by limes::expr::BoxIntegral< E, Dims >::eval(), limes::expr::ConstrainedBoxIntegral< E, Dims, Constraint >::eval(), limes::methods::monte_carlo< T >::operator()(), and limes::methods::monte_carlo< T >::with_samples().