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 | Private Member Functions | Private Attributes | List of all members
FiniteDifferenceModel< Evolver > Class Template Reference

Generic finite difference model. More...

#include <finitedifferencemodel.hpp>

+ Collaboration diagram for FiniteDifferenceModel< Evolver >:

Public Types

typedef Evolver::traits 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

 FiniteDifferenceModel (const operator_type &L, const bc_set &bcs, std::vector< Time > stoppingTimes=std::vector< Time >())
 
 FiniteDifferenceModel (Evolver evolver, std::vector< Time > stoppingTimes=std::vector< Time >())
 
const Evolver & evolver () const
 
void rollback (array_type &a, Time from, Time to, Size steps)
 
void rollback (array_type &a, Time from, Time to, Size steps, const condition_type &condition)
 

Private Member Functions

void rollbackImpl (array_type &a, Time from, Time to, Size steps, const condition_type *condition)
 

Private Attributes

Evolver evolver_
 
std::vector< TimestoppingTimes_
 

Detailed Description

template<class Evolver>
class QuantLib::FiniteDifferenceModel< Evolver >

Generic finite difference model.

Definition at line 37 of file finitedifferencemodel.hpp.

Member Typedef Documentation

◆ traits

typedef Evolver::traits traits

Definition at line 39 of file finitedifferencemodel.hpp.

◆ operator_type

typedef traits::operator_type operator_type

Definition at line 40 of file finitedifferencemodel.hpp.

◆ array_type

typedef traits::array_type array_type

Definition at line 41 of file finitedifferencemodel.hpp.

◆ bc_set

typedef traits::bc_set bc_set

Definition at line 42 of file finitedifferencemodel.hpp.

◆ condition_type

typedef traits::condition_type condition_type

Definition at line 43 of file finitedifferencemodel.hpp.

Constructor & Destructor Documentation

◆ FiniteDifferenceModel() [1/2]

FiniteDifferenceModel ( const operator_type L,
const bc_set bcs,
std::vector< Time stoppingTimes = std::vector<Time>() 
)

Definition at line 45 of file finitedifferencemodel.hpp.

◆ FiniteDifferenceModel() [2/2]

FiniteDifferenceModel ( Evolver  evolver,
std::vector< Time stoppingTimes = std::vector<Time>() 
)

Definition at line 53 of file finitedifferencemodel.hpp.

Member Function Documentation

◆ evolver()

const Evolver & evolver ( ) const

Definition at line 62 of file finitedifferencemodel.hpp.

◆ rollback() [1/2]

void rollback ( array_type a,
Time  from,
Time  to,
Size  steps 
)

solves the problem between the given times.

Warning:
being this a rollback, from must be a later time than to.

Definition at line 67 of file finitedifferencemodel.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rollback() [2/2]

void rollback ( array_type a,
Time  from,
Time  to,
Size  steps,
const condition_type condition 
)

solves the problem between the given times, applying a condition at every step.

Warning:
being this a rollback, from must be a later time than to.

Definition at line 78 of file finitedifferencemodel.hpp.

+ Here is the call graph for this function:

◆ rollbackImpl()

void rollbackImpl ( array_type a,
Time  from,
Time  to,
Size  steps,
const condition_type condition 
)
private

Definition at line 86 of file finitedifferencemodel.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ evolver_

Evolver evolver_
private

Definition at line 146 of file finitedifferencemodel.hpp.

◆ stoppingTimes_

std::vector<Time> stoppingTimes_
private

Definition at line 147 of file finitedifferencemodel.hpp.