QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
discretizeddoublebarrieroption.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2015 Thema Consulting SA
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_discretized_double_barrier_option_h
25#define quantlib_discretized_double_barrier_option_h
26
27#include <ql/discretizedasset.hpp>
28#include <ql/methods/lattices/bsmlattice.hpp>
29#include <ql/instruments/doublebarrieroption.hpp>
30#include <ql/pricingengines/vanilla/discretizedvanillaoption.hpp>
31
32namespace QuantLib {
33
35
40 public:
42 const StochasticProcess& process,
43 const TimeGrid& grid = TimeGrid());
44
45 void reset(Size size) override;
46
47 const Array& vanilla() const {
48 return vanilla_.values();
49 }
50
52 return arguments_;
53 }
54
55 std::vector<Time> mandatoryTimes() const override { return stoppingTimes_; }
56
57 void checkBarrier(Array &optvalues, const Array &grid) const;
58 protected:
59 void postAdjustValuesImpl() override;
60
61 private:
63 std::vector<Time> stoppingTimes_;
65 };
66
68
77 public:
79 const StochasticProcess& process,
80 const TimeGrid& grid = TimeGrid());
81
82 void reset(Size size) override;
83
84 std::vector<Time> mandatoryTimes() const override { return unenhanced_.mandatoryTimes(); }
85
86 protected:
87 void postAdjustValuesImpl() override;
88
89 private:
90 void adjustBarrier(Array &optvalues, const Array &grid);
92 };
93}
94
95#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Discretized asset class used by numerical methods.
const Array & values() const
Derman-Kani-Ergener-Bardhan discretized option helper class.
Standard discretized option helper class.
void checkBarrier(Array &optvalues, const Array &grid) const
std::vector< Time > mandatoryTimes() const override
const DoubleBarrierOption::arguments & arguments() const
Arguments for double barrier option calculation
multi-dimensional stochastic process class.
time grid class
Definition: timegrid.hpp:43
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35