Create option pricing engine structure, test architecture.
Some checks failed
C++ CI / build (push) Has been cancelled

This commit is contained in:
David Doebel
2026-03-08 10:15:23 +01:00
parent 1c61e664b3
commit 08298439ea
47 changed files with 815 additions and 223 deletions

53
src/Exercise.hpp Normal file
View File

@@ -0,0 +1,53 @@
//
// Created by David Doebel on 05.03.2026.
//
#ifndef QUANTENGINE_EXERCISE_HPP
#define QUANTENGINE_EXERCISE_HPP
#include <vector>
class Exercise {
public:
Exercise() = default;
virtual ~Exercise() = default;
enum class Type {
European,
American,
Bermudan
};
virtual Type type() const = 0;
protected:
std::vector<double> exercise_times_;
};
class EuropeanExercise : public Exercise {
EuropeanExercise() : type_(Type::European) {};
EuropeanExercise(double maturity) : type_(Type::European){
exercise_times_.push_back(maturity);
}
~EuropeanExercise() override = default;
[[nodiscard]] Type type() const override {
return type_;
}
private:
Type type_;
};
class AmericanExercise : public Exercise{
AmericanExercise() : type_(Type::American) {};
AmericanExercise(double maturity) : type_(Type::American) {
exercise_times_.push_back(0);
exercise_times_.push_back(maturity);
}
[[nodiscard]] Type type() const override {
return type_;
}
private:
Type type_;
};
#endif //QUANTENGINE_EXERCISE_HPP