21#include <ql/time/date.hpp>
23#include <boost/test/unit_test.hpp>
27BOOST_AUTO_TEST_SUITE(QuantExtTestSuite)
29BOOST_AUTO_TEST_SUITE(RandomVariableLsmBasisSystemTest)
33 BOOST_TEST_MESSAGE(
"Testing lsm basis system for random variables...");
35 constexpr double x0 = -2.0;
36 for (Size order = 0; order < 200; ++order) {
39 BOOST_REQUIRE(bs.size() == order + 1);
40 for (Size i = 0; i <= order; ++i) {
41 BOOST_CHECK_CLOSE(bs[i](
RandomVariable(1, x0)).at(0), std::pow(x0, i), 1E-10);
46BOOST_AUTO_TEST_SUITE_END()
48BOOST_AUTO_TEST_SUITE_END()
static std::vector< std::function< RandomVariable(const RandomVariable &)> > pathBasisSystem(Size order, QuantLib::LsmBasisSystem::PolynomialType type)
ql utility class for random variables
BOOST_AUTO_TEST_CASE(testBasisSystem1d)