/usr/include/ql/numericalmethod.hpp is in libquantlib0-dev 1.4-2+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
Copyright (C) 2004, 2005 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
<quantlib-dev@lists.sf.net>. The license is also available online at
<http://quantlib.org/license.shtml>.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
/*! \file numericalmethod.hpp
\brief Numerical method class
*/
#ifndef quantlib_lattice_hpp
#define quantlib_lattice_hpp
#include <ql/timegrid.hpp>
#include <ql/math/array.hpp>
namespace QuantLib {
class DiscretizedAsset;
//! %Lattice (tree, finite-differences) base class
class Lattice {
public:
Lattice(const TimeGrid& timeGrid) : t_(timeGrid) {}
virtual ~Lattice() {}
//!\name Inspectors
//{
const TimeGrid& timeGrid() const { return t_; }
//@}
/*! \name Numerical method interface
These methods are to be used by discretized assets and
must be overridden by developers implementing numerical
methods. Users are advised to use the corresponding
methods of DiscretizedAsset instead.
@{
*/
//! initialize an asset at the given time.
virtual void initialize(DiscretizedAsset&,
Time time) const = 0;
/*! Roll back an asset until the given time, performing any
needed adjustment.
*/
virtual void rollback(DiscretizedAsset&,
Time to) const = 0;
/*! Roll back an asset until the given time, but do not perform
the final adjustment.
\warning In version 0.3.7 and earlier, this method was
called rollAlmostBack method and performed
pre-adjustment. This is no longer true; when
migrating your code, you'll have to replace calls
such as:
\code
method->rollAlmostBack(asset,t);
\endcode
with the two statements:
\code
method->partialRollback(asset,t);
asset->preAdjustValues();
\endcode
*/
virtual void partialRollback(DiscretizedAsset&,
Time to) const = 0;
//! computes the present value of an asset.
virtual Real presentValue(DiscretizedAsset&) const = 0;
//@}
// this is a smell, but we need it. We'll rethink it later.
virtual Disposable<Array> grid(Time) const = 0;
protected:
TimeGrid t_;
};
}
#endif
|