QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
TRBDF2< Operator > Class Template Reference

TR-BDF2 scheme for finite difference methods. More...

#include <ql/methods/finitedifferences/trbdf2.hpp>

+ Collaboration diagram for TRBDF2< Operator >:

Public Types

typedef OperatorTraits< Operator > traits
 
typedef traits::operator_type operator_type
 
typedef traits::array_type array_type
 
typedef traits::bc_set bc_set
 
typedef traits::condition_type condition_type
 

Public Member Functions

 TRBDF2 (const operator_type &L, const bc_set &bcs)
 
void step (array_type &a, Time t)
 
void setStep (Time dt)
 

Private Attributes

Real alpha_
 
operator_type L_
 
operator_type I_
 
operator_type explicitTrapezoidalPart_
 
operator_type explicitBDF2PartFull_
 
operator_type explicitBDF2PartMid_
 
operator_type implicitPart_
 
Time dt_
 
bc_set bcs_
 
array_type aInit_
 

Detailed Description

template<class Operator>
class QuantLib::TRBDF2< Operator >

TR-BDF2 scheme for finite difference methods.

See http://ssrn.com/abstract=1648878 for details.

In this implementation, the passed operator must be derived from either TimeConstantOperator or TimeDependentOperator. Also, it must implement at least the following interface:

typedef ... array_type;
// copy constructor/assignment
// (these will be provided by the compiler if none is defined)
Operator(const Operator&);
Operator& operator=(const Operator&);
// inspectors
Size size();
// modifiers
void setTime(Time t);
// operator interface
array_type applyTo(const array_type&);
array_type solveFor(const array_type&);
static Operator identity(Size size);
// operator algebra
Operator operator*(Real, const Operator&);
Operator operator+(const Operator&, const Operator&);
Operator operator+(const Operator&, const Operator&);
traits::array_type array_type
Definition: trbdf2.hpp:78
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Quantity operator*(const Quantity &m, Real x)
Definition: quantity.hpp:177
Quantity operator+(const Quantity &m1, const Quantity &m2)
Definition: quantity.hpp:165
Warning:
The differential operator must be linear for this evolver to work.

Definition at line 73 of file trbdf2.hpp.

Member Typedef Documentation

◆ traits

typedef OperatorTraits<Operator> traits

Definition at line 76 of file trbdf2.hpp.

◆ operator_type

Definition at line 77 of file trbdf2.hpp.

◆ array_type

Definition at line 78 of file trbdf2.hpp.

◆ bc_set

Definition at line 79 of file trbdf2.hpp.

◆ condition_type

Definition at line 80 of file trbdf2.hpp.

Constructor & Destructor Documentation

◆ TRBDF2()

TRBDF2 ( const operator_type L,
const bc_set bcs 
)

Definition at line 82 of file trbdf2.hpp.

Member Function Documentation

◆ step()

void step ( array_type a,
Time  t 
)

Definition at line 110 of file trbdf2.hpp.

◆ setStep()

void setStep ( Time  dt)

Definition at line 88 of file trbdf2.hpp.

Member Data Documentation

◆ alpha_

Real alpha_
private

Definition at line 98 of file trbdf2.hpp.

◆ L_

operator_type L_
private

Definition at line 99 of file trbdf2.hpp.

◆ I_

operator_type I_
private

Definition at line 99 of file trbdf2.hpp.

◆ explicitTrapezoidalPart_

operator_type explicitTrapezoidalPart_
private

Definition at line 99 of file trbdf2.hpp.

◆ explicitBDF2PartFull_

operator_type explicitBDF2PartFull_
private

Definition at line 100 of file trbdf2.hpp.

◆ explicitBDF2PartMid_

operator_type explicitBDF2PartMid_
private

Definition at line 100 of file trbdf2.hpp.

◆ implicitPart_

operator_type implicitPart_
private

Definition at line 100 of file trbdf2.hpp.

◆ dt_

Time dt_
private

Definition at line 101 of file trbdf2.hpp.

◆ bcs_

bc_set bcs_
private

Definition at line 102 of file trbdf2.hpp.

◆ aInit_

array_type aInit_
private

Definition at line 103 of file trbdf2.hpp.