Adapt Yield Curve and Volatility Surface and Market Data, to be better compatible with unit test.
Some checks failed
C++ CI / build (push) Has been cancelled

This commit is contained in:
David Doebel
2026-03-12 12:10:13 +01:00
parent 08298439ea
commit f98de4d0a3
13 changed files with 50 additions and 80 deletions

View File

@@ -10,24 +10,24 @@
class MarketData {
public:
MarketData() = default;
MarketData() = delete;
MarketData(double spot, std::unique_ptr<YieldCurve> yield_curve,
std::unique_ptr<VolatilitySurface> volatility_surface)
MarketData(double spot, std::shared_ptr<const YieldCurve> yield_curve,
std::shared_ptr<const VolatilitySurface> volatility_surface)
: spot_(spot),
yield_curve_(std::move(yield_curve)),
volatility_surface_(std::move(volatility_surface)) {
}
double spot() const;
YieldCurve& yield_curve();
VolatilitySurface& volatility_surface();
const YieldCurve& yield_curve() const;
const VolatilitySurface& volatility_surface() const;
private:
double spot_;
std::unique_ptr<YieldCurve> yield_curve_;
std::unique_ptr<VolatilitySurface> volatility_surface_;
std::shared_ptr<const YieldCurve> yield_curve_;
std::shared_ptr<const VolatilitySurface> volatility_surface_;
};
#endif //QUANTENGINE_MARKETDATA_HPP
#endif //QUANTENGINE_MARKETDATA_HPP