QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
fdmstepconditioncomposite.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Andreas Gaida
5 Copyright (C) 2008 Ralph Schreyer
6 Copyright (C) 2008 Klaus Spanderen
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
26#ifndef quantlib_fdm_step_condition_composite_hpp
27#define quantlib_fdm_step_condition_composite_hpp
28
29#include <ql/time/date.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/instruments/dividendschedule.hpp>
32#include <ql/methods/finitedifferences/stepcondition.hpp>
33
34#include <list>
35
36namespace QuantLib {
37
38 class FdmMesher;
39 class Exercise;
40 class FdmSnapshotCondition;
41 class FdmInnerValueCalculator;
42
44 public:
45 typedef std::list<ext::shared_ptr<StepCondition<Array> > > Conditions;
46
47 FdmStepConditionComposite(const std::list<std::vector<Time> >& stoppingTimes,
49
50 void applyTo(Array& a, Time t) const override;
51 const std::vector<Time>& stoppingTimes() const;
52 const Conditions& conditions() const;
53
54 static ext::shared_ptr<FdmStepConditionComposite> joinConditions(
55 const ext::shared_ptr<FdmSnapshotCondition>& c1,
56 const ext::shared_ptr<FdmStepConditionComposite>& c2);
57
58 static ext::shared_ptr<FdmStepConditionComposite> vanillaComposite(
59 const DividendSchedule& schedule,
60 const ext::shared_ptr<Exercise>& exercise,
61 const ext::shared_ptr<FdmMesher>& mesher,
62 const ext::shared_ptr<FdmInnerValueCalculator>& calculator,
63 const Date& refDate,
64 const DayCounter& dayCounter);
65
66 private:
67 std::vector<Time> stoppingTimes_;
69 };
70}
71#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
const std::vector< Time > & stoppingTimes() const
static ext::shared_ptr< FdmStepConditionComposite > joinConditions(const ext::shared_ptr< FdmSnapshotCondition > &c1, const ext::shared_ptr< FdmStepConditionComposite > &c2)
std::list< ext::shared_ptr< StepCondition< Array > > > Conditions
void applyTo(Array &a, Time t) const override
static ext::shared_ptr< FdmStepConditionComposite > vanillaComposite(const DividendSchedule &schedule, const ext::shared_ptr< Exercise > &exercise, const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< FdmInnerValueCalculator > &calculator, const Date &refDate, const DayCounter &dayCounter)
condition to be applied at every time step
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
Definition: any.hpp:35
std::vector< ext::shared_ptr< Dividend > > DividendSchedule