Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
simd_dispatch.hpp File Reference

Public API for SIMD-accelerated β and γ batch computation. More...

#include "cpu_features.hpp"
#include "momentum/momentum.hpp"
#include <vector>

Go to the source code of this file.

Classes

struct  srfm::simd::SimdGammaCompute
 Internal factory helper for constructing LorentzFactor objects from pre-computed gamma scalars (friend of LorentzFactor). More...
 
class  srfm::simd::BetaCalculator
 Stateful wrapper around computeBetaBatch / computeGammaBatch. More...
 

Namespaces

namespace  srfm
 
namespace  srfm::simd
 

Functions

std::vector< srfm::momentum::BetaVelocity > srfm::simd::computeBetaBatch (const std::vector< double > &velocities, double &running_max) noexcept
 
std::vector< srfm::momentum::LorentzFactor > srfm::simd::computeGammaBatch (const std::vector< srfm::momentum::BetaVelocity > &betas) noexcept
 Compute γ_i = 1/√(1 − β_i²) for every element.
 

Detailed Description

Public API for SIMD-accelerated β and γ batch computation.

Module: include/srfm/simd/ Owner: AGT-08 — 2026-03-01

Responsibility

Expose two vectorised batch functions and a stateful BetaCalculator that wire into the hot path of the SRFM financial signal pipeline.

computeBetaBatch() — batch |v_i| / running_max → vector<BetaVelocity> computeGammaBatch() — batch 1/√(1−β²) → vector<LorentzFactor>

At program start-up the module probes the CPU (via cpu_features.hpp) and selects AVX-512F → AVX2 → scalar automatically. Existing callers see no interface change.

Guarantees

• All functions are noexcept. • computeBetaBatch() returns one BetaVelocity per input velocity. • computeGammaBatch() returns one LorentzFactor per input BetaVelocity. • Results are numerically identical to the scalar reference path (verified by the test suite in tests/momentum/test_simd.cpp). • BetaCalculator is NOT thread-safe (it owns mutable running_max state). Use one BetaCalculator per thread, or protect with a mutex.

NOT Responsible For

• Sourcing raw velocity data — caller provides the input vector. • Cross-session running_max persistence — call reset() between sessions. • Thread safety for BetaCalculator — caller's responsibility.

Definition in file simd_dispatch.hpp.