38 struct mapped_payoff {
39 explicit mapped_payoff(
41 const ext::function<
Real(
Real)>& gridMapping)
52 ext::shared_ptr<FdmMesher> mesher,
54 ext::function<
Real(
Real)> gridMapping)
69 for (
const auto& i : *
mesher_->layout()) {
71 if (!initialized[xn]) {
72 initialized[xn] =
true;
85 if (coord == 0 || coord == dim-1)
97 = ((
f(a) != 0.0 ||
f(
b) != 0.0) ?
Real((
f(a)+
f(
b))*5e-5) : 1e-4);
109 const ext::shared_ptr<Payoff>&
payoff,
110 const ext::shared_ptr<FdmMesher>& mesher,
113 payoff, mesher, direction,
117 FdmLogBasketInnerValue::FdmLogBasketInnerValue(ext::shared_ptr<BasketPayoff>
payoff,
118 ext::shared_ptr<FdmMesher> mesher)
125 x[i] = std::exp(
mesher_->location(iter, i));
Basket option on a number of assets.
1-D array used in linear algebra.
Size size() const
dimension of the array
Real avgInnerValue(const FdmLinearOpIterator &iter, Time t) override
const ext::shared_ptr< FdmMesher > mesher_
std::vector< Real > avgInnerValues_
FdmCellAveragingInnerValue(ext::shared_ptr< Payoff > payoff, ext::shared_ptr< FdmMesher > mesher, Size direction, ext::function< Real(Real)> gridMapping=[](Real x){ return x;})
Real avgInnerValueCalc(const FdmLinearOpIterator &iter, Time t)
Real innerValue(const FdmLinearOpIterator &iter, Time) override
const ext::function< Real(Real)> gridMapping_
const ext::shared_ptr< Payoff > payoff_
const std::vector< Size > & coordinates() const
Real avgInnerValue(const FdmLinearOpIterator &iter, Time) override
const ext::shared_ptr< BasketPayoff > payoff_
const ext::shared_ptr< FdmMesher > mesher_
Real innerValue(const FdmLinearOpIterator &iter, Time) override
FdmLogInnerValue(const ext::shared_ptr< Payoff > &payoff, const ext::shared_ptr< FdmMesher > &mesher, Size direction)
Integral of a one-dimensional function.
ext::function< Real(Real)> b
const ext::function< Real(Real)> & gridMapping_
layer of abstraction to calculate the inner value
memory layout of a fdm linear operator
const ext::shared_ptr< FdmMesher > mesher_
const ext::shared_ptr< Payoff > payoff_
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
ext::shared_ptr< QuantLib::Payoff > payoff
integral of a one-dimensional function using Simpson formula