26#ifndef quantlib_basket_option_hpp
27#define quantlib_basket_option_hpp
57 return *std::min_element(a.
begin(), a.
end());
66 return *std::max_element(a.
begin(), a.
end());
94 "payoff is only defined for two underlyings");
105 const ext::shared_ptr<Exercise>&);
111 BasketOption::results> {};
1-D array used in linear algebra.
1-D array used in linear algebra.
const_iterator end() const
Size size() const
dimension of the array
const_iterator begin() const
AverageBasketPayoff(const ext::shared_ptr< Payoff > &p, Array a)
AverageBasketPayoff(const ext::shared_ptr< Payoff > &p, Size n)
Real accumulate(const Array &a) const override
Basket-option engine base class
Basket option on a number of assets.
Real operator()(Real price) const override
~BasketPayoff() override=default
std::string description() const override
ext::shared_ptr< Payoff > basePayoff()
virtual Real operator()(const Array &a) const
std::string name() const override
ext::shared_ptr< Payoff > basePayoff_
virtual Real accumulate(const Array &a) const =0
BasketPayoff(ext::shared_ptr< Payoff > p)
template base class for option pricing engines
MaxBasketPayoff(const ext::shared_ptr< Payoff > &p)
Real accumulate(const Array &a) const override
MinBasketPayoff(const ext::shared_ptr< Payoff > &p)
Real accumulate(const Array &a) const override
Base class for options on multiple assets.
Abstract base class for option payoffs.
Real accumulate(const Array &a) const override
SpreadBasketPayoff(const ext::shared_ptr< Payoff > &p)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
Option on multiple assets.
Payoffs for various options.