QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
MixedScheme< Operator > Class Template Reference

Mixed (explicit/implicit) scheme for finite difference methods. More...

#include <mixedscheme.hpp>

+ Inheritance diagram for MixedScheme< Operator >:
+ Collaboration diagram for MixedScheme< 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

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

Protected Attributes

operator_type L_
 
operator_type I_
 
operator_type explicitPart_
 
operator_type implicitPart_
 
Time dt_
 
Real theta_
 
bc_set bcs_
 

Detailed Description

template<class Operator>
class QuantLib::MixedScheme< Operator >

Mixed (explicit/implicit) scheme for finite difference methods.

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: mixedscheme.hpp:78
const DefaultType & t
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 mixedscheme.hpp.

Member Typedef Documentation

◆ traits

typedef OperatorTraits<Operator> traits

Definition at line 76 of file mixedscheme.hpp.

◆ operator_type

Definition at line 77 of file mixedscheme.hpp.

◆ array_type

Definition at line 78 of file mixedscheme.hpp.

◆ bc_set

Definition at line 79 of file mixedscheme.hpp.

◆ condition_type

Definition at line 80 of file mixedscheme.hpp.

Constructor & Destructor Documentation

◆ MixedScheme()

MixedScheme ( const operator_type L,
Real  theta,
bc_set  bcs 
)

Definition at line 82 of file mixedscheme.hpp.

Member Function Documentation

◆ step()

void step ( array_type a,
Time  t 
)

Definition at line 105 of file mixedscheme.hpp.

◆ setStep()

void setStep ( Time  dt)

Definition at line 87 of file mixedscheme.hpp.

Member Data Documentation

◆ L_

operator_type L_
protected

Definition at line 95 of file mixedscheme.hpp.

◆ I_

operator_type I_
protected

Definition at line 95 of file mixedscheme.hpp.

◆ explicitPart_

operator_type explicitPart_
protected

Definition at line 95 of file mixedscheme.hpp.

◆ implicitPart_

operator_type implicitPart_
protected

Definition at line 95 of file mixedscheme.hpp.

◆ dt_

Time dt_
protected

Definition at line 96 of file mixedscheme.hpp.

◆ theta_

Real theta_
protected

Definition at line 97 of file mixedscheme.hpp.

◆ bcs_

bc_set bcs_
protected

Definition at line 98 of file mixedscheme.hpp.