QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
discretizedbarrieroption.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2014 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_barrier_option_h
25#define quantlib_discretized_barrier_option_h
26
27#include <ql/discretizedasset.hpp>
28#include <ql/methods/lattices/bsmlattice.hpp>
29#include <ql/instruments/barrieroption.hpp>
30#include <ql/pricingengines/vanilla/discretizedvanillaoption.hpp>
31
32namespace QuantLib {
33
35 public:
37 const StochasticProcess& process,
38 const TimeGrid& grid = TimeGrid());
39
40 void reset(Size size) override;
41
42 const Array& vanilla() const {
43 return vanilla_.values();
44 }
45
47 return arguments_;
48 }
49
50 std::vector<Time> mandatoryTimes() const override { return stoppingTimes_; }
51
52 void checkBarrier(Array &optvalues, const Array &grid) const;
53 protected:
54 void postAdjustValuesImpl() override;
55
56 private:
58 std::vector<Time> stoppingTimes_;
60 };
61
63 public:
65 const StochasticProcess& process,
66 const TimeGrid& grid = TimeGrid());
67
68 void reset(Size size) override;
69
70 std::vector<Time> mandatoryTimes() const override { return unenhanced_.mandatoryTimes(); }
71
72 protected:
73 void postAdjustValuesImpl() override;
74
75 private:
76 void adjustBarrier(Array &optvalues, const Array &grid);
78 };
79}
80
81
82
83
84
85#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Arguments for barrier option calculation
Discretized asset class used by numerical methods.
const Array & values() const
void checkBarrier(Array &optvalues, const Array &grid) const
const BarrierOption::arguments & arguments() const
std::vector< Time > mandatoryTimes() const override
std::vector< Time > mandatoryTimes() const override
void adjustBarrier(Array &optvalues, const Array &grid)
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