-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created PDE diretcory for finite_diff_method ofr one/multi factor & r…
…e factored option factory to return concrete payoff type
- Loading branch information
1 parent
f2e5759
commit 3bf3411
Showing
40 changed files
with
401 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
include/solver/finite_difference_method/pde/multi_factor/base_convection_diffusion_pde.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// Created by anthony on 26/08/2024. | ||
// | ||
|
||
#ifndef BASE_CONVECTION_DIFFUSION_PDE_H | ||
#define BASE_CONVECTION_DIFFUSION_PDE_H | ||
|
||
|
||
|
||
|
||
|
||
#endif //BASE_CONVECTION_DIFFUSION_PDE_H |
22 changes: 22 additions & 0 deletions
22
include/solver/finite_difference_method/pde/one_factor/base_convection_diffusion_pde.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef BASE_CONVECTION_DIFFUSION_PDE_H | ||
#define BASE_CONVECTION_DIFFUSION_PDE_H | ||
|
||
namespace OptionPricer::PDE::OneFactor { | ||
|
||
class ConvectionDiffusionPDE { | ||
public: | ||
virtual ~ConvectionDiffusionPDE(); | ||
|
||
virtual double diffusion(const double& t,const double& x) const = 0; | ||
virtual double convection(const double& t,const double& x) const = 0; | ||
virtual double reaction(const double& t,const double& x) const = 0; | ||
virtual double rightHandSide(const double& t,const double& x)const = 0; | ||
|
||
virtual double boundaryLeft(const double& t,const double& x)const = 0; | ||
virtual double boundaryRight(const double& t,const double& x)const = 0; | ||
virtual double initialCondition(const double& x) const = 0; | ||
}; | ||
|
||
} | ||
|
||
#endif //BASE_CONVECTION_DIFFUSION_PDE_H |
30 changes: 30 additions & 0 deletions
30
include/solver/finite_difference_method/pde/one_factor/black_scholes_pde.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef BLACK_SCHOLES_PDE_H | ||
#define BLACK_SCHOLES_PDE_H | ||
|
||
#include "option/single_path/european_option.h" | ||
#include "solver/finite_difference_method/pde/one_factor/base_convection_diffusion_pde.h" | ||
|
||
namespace OptionPricer::PDE::OneFactor { | ||
|
||
class BlackScholesPDE : public ConvectionDiffusionPDE { | ||
public: | ||
BlackScholesPDE(std::shared_ptr<EuropeanOption> option, std::shared_ptr<IMarketData> marketData); | ||
virtual ~BlackScholesPDE(); | ||
|
||
virtual double diffusion(const double& t,const double& x) const; | ||
virtual double convection(const double& t,const double& x) const; | ||
virtual double reaction(const double& t,const double& x) const; | ||
virtual double rightHandSide(const double& t,const double& x) const; | ||
|
||
virtual double boundaryLeft(const double& t,const double& x) const; | ||
virtual double boundaryRight(const double& t,const double& x) const; | ||
virtual double initialCondition(const double& x) const; | ||
|
||
private: | ||
std::shared_ptr<EuropeanOption> option_; | ||
std::shared_ptr<IMarketData> marketData_; | ||
}; | ||
|
||
} | ||
|
||
#endif //BLACK_SCHOLES_PDE_H |
Oops, something went wrong.