|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <tensor.hpp>
Public Member Functions | |
| CachedMetricTensor (MetricTensor metric, double tol=1e-8) | |
| MetricMatrix | evaluate (const SpacetimePoint &x) const |
| std::optional< MetricMatrix > | inverse (const SpacetimePoint &x) const |
| Delegate: compute g^μν (inverse metric) at x. | |
| bool | is_lorentzian (const SpacetimePoint &x) const |
| Delegate: return true iff metric has Lorentzian signature (−,+,+,+) at x. | |
| double | spacetime_interval (const SpacetimePoint &x, const FourVelocity &dx) const |
| Delegate: compute ds² = g_μν dx^μ dx^ν at x. | |
| void | invalidate () const noexcept |
| Invalidate the cache, forcing re-evaluation on the next call to evaluate(). | |
Static Public Member Functions | |
| static CachedMetricTensor | make_minkowski (double time_scale=1.0, double spatial_scale=1.0) |
| Flat Minkowski-like metric: g = diag(−time_scale², σ², σ², σ²). | |
| static CachedMetricTensor | make_diagonal (double time_scale, const std::array< double, 3 > &vol) |
| Diagonal metric from per-asset volatilities. | |
| static CachedMetricTensor | make_from_covariance (double time_scale, const Eigen::Matrix3d &cov) |
| Full covariance-based metric from a 3×3 asset covariance matrix. | |
Cache wrapper around MetricTensor::evaluate().
MetricTensor::evaluate() is called many times per geodesic integration step (once per Christoffel finite-difference probe). When the probe points are close together, the metric value changes negligibly. This wrapper avoids redundant computation by caching the most recently evaluated (point, result) pair and returning the cached result whenever the requested point is within tol (L∞ norm) of the cached point.
All other MetricTensor operations (inverse, is_lorentzian, spacetime_interval) are delegated directly to the inner MetricTensor without caching, as they are called far less frequently.
NOT thread-safe — one instance per thread / per GeodesicSolver.
Definition at line 271 of file tensor.hpp.
|
inlineexplicit |
Construct wrapping an existing MetricTensor with an optional tolerance.
| metric | MetricTensor to wrap (copied by value). |
| tol | L∞ distance threshold for cache hit (default 1e-8). |
Definition at line 277 of file tensor.hpp.
|
inline |
Evaluate g_μν at x, returning a cached result when the point is close enough to the previously cached point (L∞ distance < tol).
Definition at line 282 of file tensor.hpp.
|
inlinenoexcept |
Invalidate the cache, forcing re-evaluation on the next call to evaluate().
Definition at line 309 of file tensor.hpp.
|
inline |
Delegate: compute g^μν (inverse metric) at x.
Definition at line 293 of file tensor.hpp.
|
inline |
Delegate: return true iff metric has Lorentzian signature (−,+,+,+) at x.
Definition at line 298 of file tensor.hpp.
|
inlinestatic |
Diagonal metric from per-asset volatilities.
Definition at line 321 of file tensor.hpp.
|
inlinestatic |
Full covariance-based metric from a 3×3 asset covariance matrix.
Definition at line 327 of file tensor.hpp.
|
inlinestatic |
Flat Minkowski-like metric: g = diag(−time_scale², σ², σ², σ²).
Definition at line 314 of file tensor.hpp.
|
inline |
Delegate: compute ds² = g_μν dx^μ dx^ν at x.
Definition at line 303 of file tensor.hpp.