#ifndef CLASS_PDEBS #define CLASS_PDEBS #include #include "PDE.h" /* * PDEBS is a class which extends PDE to solve both the constant and variable * volatility Black-Scholes equations. */ class PDEBS : public PDE { public: PDEBS(int N, double dt, double a, double b, double theta, double s, double r, double K, bool call); // Implementations of the virtual functions of the PDE class. void setOperator(); void setBC(); void setIC(); private: inline double sigma(double x, double t); // Function to calculate sigma. bool call; // If true, then a call initial // condition is used; otherwise, // use a put. double K; // Strike price. double r; // Interest rate. double s; // Constant volatility to use. }; #endif