24#include <ql/errors.hpp>
25#include <ql/instruments/payoffs.hpp>
26#include <ql/pricingengines/vanilla/mcamericanengine.hpp>
34 : payoff_(
std::move(payoff)),
35 v_(
LsmBasisSystem::pathBasisSystem(polynomialOrder, polynomialType)) {
42 "insufficient polynomial type");
47 const ext::shared_ptr<StrikedTypePayoff> strikePayoff
48 = ext::dynamic_pointer_cast<StrikedTypePayoff>(
payoff_);
50 if (strikePayoff !=
nullptr) {
69 std::vector<ext::function<
Real(
Real)> >
std::vector< ext::function< Real(Real)> > basisSystem() const override
Real state(const Path &path, Size t) const override
Real payoff(Real state) const
Real operator()(const Path &path, Size t) const override
std::vector< ext::function< Real(Real)> > v_
AmericanPathPricer(ext::shared_ptr< Payoff > payoff, Size polynomialOrder, LsmBasisSystem::PolynomialType polynomialType)
const ext::shared_ptr< Payoff > payoff_
single-factor random walk
std::size_t Size
size of a container