|
quant-pricer-cpp
|
Finite-difference PDE pricer (Crank–Nicolson) for European options. More...
Classes | |
| struct | BarrierPdeGreeksResult |
| struct | BarrierPdeParams |
| struct | GridSpec |
| Grid specification for PDE solver. More... | |
| struct | PdeParams |
| PDE pricing parameters and grid configuration. More... | |
| struct | PdeResult |
Functions | |
| double | price_barrier_crank_nicolson (const BarrierPdeParams ¶ms, ::quant::OptionType opt) |
| BarrierPdeGreeksResult | price_barrier_crank_nicolson_greeks (const BarrierPdeParams ¶ms, ::quant::OptionType opt) |
| PdeResult | price_crank_nicolson (const PdeParams &p) |
| std::vector< double > | solve_tridiagonal (const std::vector< double > &a, const std::vector< double > &b, const std::vector< double > &c, const std::vector< double > &d) |
Finite-difference PDE pricer (Crank–Nicolson) for European options.
| double quant::pde::price_barrier_crank_nicolson | ( | const BarrierPdeParams & | params, |
| ::quant::OptionType | opt | ||
| ) |
| BarrierPdeGreeksResult quant::pde::price_barrier_crank_nicolson_greeks | ( | const BarrierPdeParams & | params, |
| ::quant::OptionType | opt | ||
| ) |
Price European option via Crank–Nicolson (S-space or log-space). Boundary conditions: Dirichlet at S=0, Dirichlet or Neumann at Smax.
| std::vector< double > quant::pde::solve_tridiagonal | ( | const std::vector< double > & | a, |
| const std::vector< double > & | b, | ||
| const std::vector< double > & | c, | ||
| const std::vector< double > & | d | ||
| ) |
Solve tridiagonal system Ax = d with Thomas algorithm. a: sub-diagonal (size n-1), b: main diagonal (size n), c: super-diagonal (size n-1) d: RHS (size n). Returns x of size n.