Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FdmLgmOp Class Reference

#include <qle/methods/fdmlgmop.hpp>

+ Inheritance diagram for FdmLgmOp:
+ Collaboration diagram for FdmLgmOp:

Public Member Functions

 FdmLgmOp (const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< StochasticProcess1D > &process)
 
Size size () const override
 
void setTime (Time t1, Time t2) override
 
Array apply (const Array &r) const override
 
Array apply_mixed (const Array &r) const override
 
Array apply_direction (Size direction, const Array &r) const override
 
Array solve_splitting (Size direction, const Array &r, Real s) const override
 
Array preconditioner (const Array &r, Real s) const override
 
std::vector< QuantLib::SparseMatrix > toMatrixDecomp () const override
 

Private Attributes

ext::shared_ptr< FdmMesher > mesher_
 
ext::shared_ptr< StochasticProcess1Dprocess_
 
FirstDerivativeOp dxMap_
 
TripleBandLinearOp dxxMap_
 
TripleBandLinearOp mapT_
 

Detailed Description

Definition at line 34 of file fdmlgmop.hpp.

Constructor & Destructor Documentation

◆ FdmLgmOp()

FdmLgmOp ( const ext::shared_ptr< FdmMesher > &  mesher,
const ext::shared_ptr< StochasticProcess1D > &  process 
)

Definition at line 27 of file fdmlgmop.cpp.

28 : mesher_(mesher), process_(process), dxMap_(FirstDerivativeOp(0, mesher)), dxxMap_(SecondDerivativeOp(0, mesher)),
29 mapT_(0, mesher) {}
TripleBandLinearOp dxxMap_
Definition: fdmlgmop.hpp:54
ext::shared_ptr< StochasticProcess1D > process_
Definition: fdmlgmop.hpp:52
TripleBandLinearOp mapT_
Definition: fdmlgmop.hpp:55
ext::shared_ptr< FdmMesher > mesher_
Definition: fdmlgmop.hpp:51
FirstDerivativeOp dxMap_
Definition: fdmlgmop.hpp:53

Member Function Documentation

◆ size()

Size size ( ) const
override

Definition at line 36 of file fdmlgmop.cpp.

36{ return 1u; }

◆ setTime()

void setTime ( Time  t1,
Time  t2 
)
override

Definition at line 31 of file fdmlgmop.cpp.

31 {
32 Real v = process_->variance(t1, 0.0, t2 - t1) / (t2 - t1);
33 mapT_.axpyb(Array(), dxMap_, dxxMap_.mult(0.5 * Array(mesher_->layout()->size(), v)), Array(1, 0));
34}

◆ apply()

Array apply ( const Array &  r) const
override

Definition at line 38 of file fdmlgmop.cpp.

38{ return mapT_.apply(u); }

◆ apply_mixed()

Array apply_mixed ( const Array &  r) const
override

Definition at line 49 of file fdmlgmop.cpp.

49 {
50 Array retVal(r.size(), 0.0);
51 return retVal;
52}

◆ apply_direction()

Array apply_direction ( Size  direction,
const Array &  r 
) const
override

Definition at line 40 of file fdmlgmop.cpp.

40 {
41 if (direction == 0)
42 return mapT_.apply(r);
43 else {
44 Array retVal(r.size(), 0.0);
45 return retVal;
46 }
47}

◆ solve_splitting()

Array solve_splitting ( Size  direction,
const Array &  r,
Real  s 
) const
override

Definition at line 54 of file fdmlgmop.cpp.

54 {
55 if (direction == 0)
56 return mapT_.solve_splitting(r, dt, 1.0);
57 else {
58 Array retVal(r);
59 return retVal;
60 }
61}
+ Here is the caller graph for this function:

◆ preconditioner()

Array preconditioner ( const Array &  r,
Real  s 
) const
override

Definition at line 63 of file fdmlgmop.cpp.

63{ return solve_splitting(0, r, dt); }
Array solve_splitting(Size direction, const Array &r, Real s) const override
Definition: fdmlgmop.cpp:54
+ Here is the call graph for this function:

◆ toMatrixDecomp()

std::vector< QuantLib::SparseMatrix > toMatrixDecomp ( ) const
override

Definition at line 66 of file fdmlgmop.cpp.

66 {
67 std::vector<QuantLib::SparseMatrix> retVal(1, mapT_.toMatrix());
68 return retVal;
69}

Member Data Documentation

◆ mesher_

ext::shared_ptr<FdmMesher> mesher_
private

Definition at line 51 of file fdmlgmop.hpp.

◆ process_

ext::shared_ptr<StochasticProcess1D> process_
private

Definition at line 52 of file fdmlgmop.hpp.

◆ dxMap_

FirstDerivativeOp dxMap_
private

Definition at line 53 of file fdmlgmop.hpp.

◆ dxxMap_

TripleBandLinearOp dxxMap_
private

Definition at line 54 of file fdmlgmop.hpp.

◆ mapT_

TripleBandLinearOp mapT_
private

Definition at line 55 of file fdmlgmop.hpp.