Restructure C++ core into cpp module and package bindings.

Move the pricing engine sources out of src/ into cpp/, add the closed-form engine and pybind wiring, and align tests/build targets with the new project layout.

Made-with: Cursor
This commit is contained in:
David Doebel
2026-04-02 16:30:33 +02:00
parent 61df0b425d
commit 087a2f0d74
53 changed files with 803 additions and 195 deletions

31
cpp/RandomGenerator.hpp Normal file
View File

@@ -0,0 +1,31 @@
/**
* @file RandomGenerator.hpp
* @brief Random numbers for Monte Carlo (Gaussian draws).
*/
#ifndef QUANTENGINE_RANDOMGENERATOR_HPP
#define QUANTENGINE_RANDOMGENERATOR_HPP
#include <random>
/** @brief Interface for standard normal variates. */
class RandomGenerator {
public:
RandomGenerator() = default;
virtual ~RandomGenerator() = default;
virtual double nextGaussian() = 0;
virtual std::vector<double> nextGaussianVector(std::size_t n) = 0;
};
/** @brief @c std::mt19937 with normal distribution. */
class MersenneTwister : public RandomGenerator {
public:
MersenneTwister() = default;
double nextGaussian() override;
std::vector<double> nextGaussianVector(std::size_t n) override;
private:
std::mt19937 generator_;
std::normal_distribution<> distr_ {0.0, 1.0};
};
#endif //QUANTENGINE_RANDOMGENERATOR_HPP