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

#include <discretizedbarrieroption.hpp>

+ Inheritance diagram for DiscretizedBarrierOption:
+ Collaboration diagram for DiscretizedBarrierOption:

Public Member Functions

 DiscretizedBarrierOption (const BarrierOption::arguments &, const StochasticProcess &process, const TimeGrid &grid=TimeGrid())
 
void reset (Size size) override
 
const Arrayvanilla () const
 
const BarrierOption::argumentsarguments () const
 
std::vector< TimemandatoryTimes () const override
 
void checkBarrier (Array &optvalues, const Array &grid) const
 
- Public Member Functions inherited from DiscretizedAsset
 DiscretizedAsset ()
 
virtual ~DiscretizedAsset ()=default
 
Time time () const
 
Timetime ()
 
const Arrayvalues () const
 
Arrayvalues ()
 
const ext::shared_ptr< Lattice > & method () const
 
void initialize (const ext::shared_ptr< Lattice > &, Time t)
 
void rollback (Time to)
 
void partialRollback (Time to)
 
Real presentValue ()
 
void preAdjustValues ()
 
void postAdjustValues ()
 
void adjustValues ()
 

Protected Member Functions

void postAdjustValuesImpl () override
 
- Protected Member Functions inherited from DiscretizedAsset
bool isOnTime (Time t) const
 
virtual void preAdjustValuesImpl ()
 

Private Attributes

BarrierOption::arguments arguments_
 
std::vector< TimestoppingTimes_
 
DiscretizedVanillaOption vanilla_
 

Additional Inherited Members

- Protected Types inherited from DiscretizedAsset
enum class  CouponAdjustment { pre , post }
 
- Protected Attributes inherited from DiscretizedAsset
Time time_
 
Time latestPreAdjustment_
 
Time latestPostAdjustment_
 
Array values_
 

Detailed Description

Definition at line 34 of file discretizedbarrieroption.hpp.

Constructor & Destructor Documentation

◆ DiscretizedBarrierOption()

DiscretizedBarrierOption ( const BarrierOption::arguments args,
const StochasticProcess process,
const TimeGrid grid = TimeGrid() 
)

Definition at line 25 of file discretizedbarrieroption.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ reset()

void reset ( Size  size)
overridevirtual

This method should initialize the asset values to an Array of the given size and with values depending on the particular asset.

Implements DiscretizedAsset.

Definition at line 43 of file discretizedbarrieroption.cpp.

+ Here is the call graph for this function:

◆ vanilla()

const Array & vanilla ( ) const

Definition at line 42 of file discretizedbarrieroption.hpp.

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

◆ arguments()

const BarrierOption::arguments & arguments ( ) const

Definition at line 46 of file discretizedbarrieroption.hpp.

+ Here is the caller graph for this function:

◆ mandatoryTimes()

std::vector< Time > mandatoryTimes ( ) const
overridevirtual

This method returns the times at which the numerical method should stop while rolling back the asset. Typical examples include payment times, exercise times and such.

Note
The returned values are not guaranteed to be sorted.

Implements DiscretizedAsset.

Definition at line 50 of file discretizedbarrieroption.hpp.

+ Here is the caller graph for this function:

◆ checkBarrier()

void checkBarrier ( Array optvalues,
const Array grid 
) const

Definition at line 58 of file discretizedbarrieroption.cpp.

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

◆ postAdjustValuesImpl()

void postAdjustValuesImpl ( )
overrideprotectedvirtual

This method performs the actual post-adjustment

Reimplemented from DiscretizedAsset.

Definition at line 49 of file discretizedbarrieroption.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ arguments_

BarrierOption::arguments arguments_
private

Definition at line 57 of file discretizedbarrieroption.hpp.

◆ stoppingTimes_

std::vector<Time> stoppingTimes_
private

Definition at line 58 of file discretizedbarrieroption.hpp.

◆ vanilla_

DiscretizedVanillaOption vanilla_
private

Definition at line 59 of file discretizedbarrieroption.hpp.