FTQuant  0.1
u_MonteCarlo.cpp
Go to the documentation of this file.
1 
7 #include <gtest/gtest.h>
8 #include <ftqlib.hpp>
9 
14  MonteCarloResult result(0, 1000, 1e-3, 1.25);
15  EXPECT_EQ(
16  result.to_json(),
17  R"({"result_code": 0, "n_simulations": 1000, "error": 0.001000, "result": 1.250000})");
18 
19  MonteCarloResult result2(1, 100000, 1e-6, 1.253);
20  EXPECT_EQ(
21  result2.to_json(),
22  R"({"result_code": 1, "n_simulations": 100000, "error": 0.000001, "result": 1.253000})");
23 }
A container for storing the result of a Monte-Carlo simulation.
Definition: ftqlib.hpp:43
std::string to_json() const
A function that converts a MonteCarloResult to a JSON string.
Definition: MonteCarlo.cpp:14
The main header file for the FTQlib library.
TEST(MonteCarloResult, to_json)
Unit test for MonteCarloResult::to_json().