You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: test/naive_monte_carlo_test.cpp
+5-40
Original file line number
Diff line number
Diff line change
@@ -104,39 +104,6 @@ void test_constant()
104
104
}
105
105
106
106
107
-
template<classReal>
108
-
voidtest_exception_from_integrand()
109
-
{
110
-
std::cout << "Testing that a reasonable action is performed by the Monte-Carlo integrator when the integrand throws an exception on type " << boost::typeindex::type_id<Real>().pretty_name() << "\n";
111
-
auto g = [](std::vector<Real> const & x)->Real
112
-
{
113
-
if (x[0] > 0.5 && x[0] < 0.5001)
114
-
{
115
-
throwstd::domain_error("You have done something wrong.\n");
std::cout << "Testing that product functions are integrated correctly by naive Monte-Carlo on type " << boost::typeindex::type_id<Real>().pretty_name() << "\n";
228
195
auto g = [&](std::vector<Real> const & x)->Real
229
196
{
230
-
double y = 1;
197
+
Real y = 1;
231
198
for (uint64_t i = 0; i < x.size(); ++i)
232
199
{
233
200
y *= 2*x[i];
@@ -256,7 +223,7 @@ void test_alternative_rng_1()
256
223
std::cout << "Testing that alternative RNGs work correctly using naive Monte-Carlo on type " << boost::typeindex::type_id<Real>().pretty_name() << "\n";
257
224
auto g = [&](std::vector<Real> const & x)->Real
258
225
{
259
-
double y = 1;
226
+
Real y = 1;
260
227
for (uint64_t i = 0; i < x.size(); ++i)
261
228
{
262
229
y *= 2*x[i];
@@ -299,7 +266,7 @@ void test_alternative_rng_2()
299
266
std::cout << "Testing that alternative RNGs work correctly using naive Monte-Carlo on type " << boost::typeindex::type_id<Real>().pretty_name() << "\n";
0 commit comments