Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Member Functions | List of all members
srfm::simd::BetaCalculator Class Reference

Stateful wrapper around computeBetaBatch / computeGammaBatch. More...

#include <simd_dispatch.hpp>

Public Member Functions

 BetaCalculator () noexcept
 Construct a fresh calculator. running_max starts at 0.0.
 
std::vector< srfm::momentum::BetaVelocity > computeBetaBatch (const std::vector< double > &velocities) noexcept
 Compute β_i = |v_i| / running_max for a batch of velocities.
 
std::vector< srfm::momentum::LorentzFactor > computeGammaBatch (const std::vector< srfm::momentum::BetaVelocity > &betas) noexcept
 Compute γ_i = 1/√(1 − β_i²) for a batch of betas.
 
void reset () noexcept
 Reset the running maximum to 0.0.
 
double running_max () const noexcept
 Returns the current running maximum (read-only).
 
SimdLevel simd_level () const noexcept
 Returns the SIMD level selected for this process.
 

Detailed Description

Stateful wrapper around computeBetaBatch / computeGammaBatch.

Maintains a session-scoped running_max so callers do not need to manage it manually. Existing call sites that use RelativisticSignalProcessor can migrate by:

// Before (scalar):
double rmax = 0.0;
auto betas = scalar_beta_batch(velocities, rmax);
auto gammas = scalar_gamma_batch(betas);
// After (SIMD-dispatched, same semantics):
auto betas = calc.computeBetaBatch(velocities);
auto gammas = calc.computeGammaBatch(betas);
Stateful wrapper around computeBetaBatch / computeGammaBatch.
std::vector< srfm::momentum::LorentzFactor > computeGammaBatch(const std::vector< srfm::momentum::BetaVelocity > &betas) noexcept
Compute γ_i = 1/√(1 − β_i²) for a batch of betas.
std::vector< srfm::momentum::BetaVelocity > computeBetaBatch(const std::vector< double > &velocities) noexcept
Compute β_i = |v_i| / running_max for a batch of velocities.

NOT thread-safe. Create one BetaCalculator per thread.

Definition at line 134 of file simd_dispatch.hpp.

Constructor & Destructor Documentation

◆ BetaCalculator()

srfm::simd::BetaCalculator::BetaCalculator ( )
noexcept

Member Function Documentation

◆ computeBetaBatch()

std::vector< srfm::momentum::BetaVelocity > srfm::simd::BetaCalculator::computeBetaBatch ( const std::vector< double > &  velocities)
noexcept

Compute β_i = |v_i| / running_max for a batch of velocities.

Delegates to the runtime-selected SIMD kernel. running_max is advanced to include this batch's maximum |velocity|.

Parameters
velocitiesRaw price velocities (any finite double).
Returns
One BetaVelocity per velocity, in order.
Examples
/home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/simd_dispatch.hpp.

Definition at line 157 of file simd_dispatch.cpp.

◆ computeGammaBatch()

std::vector< srfm::momentum::LorentzFactor > srfm::simd::BetaCalculator::computeGammaBatch ( const std::vector< srfm::momentum::BetaVelocity > &  betas)
noexcept

Compute γ_i = 1/√(1 − β_i²) for a batch of betas.

Delegates to the runtime-selected SIMD kernel.

Parameters
betasOutput from a previous call to computeBetaBatch().
Returns
One LorentzFactor per beta, in order.
Examples
/home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/simd_dispatch.hpp.

Definition at line 164 of file simd_dispatch.cpp.

◆ reset()

void srfm::simd::BetaCalculator::reset ( )
noexcept

Reset the running maximum to 0.0.

Call between trading sessions to prevent stale state from inflating the denominator and artificially suppressing beta values.

Examples
/home/runner/work/Special-Relativity-in-Financial-Modeling/Special-Relativity-in-Financial-Modeling/include/srfm/simd/simd_dispatch.hpp.

Definition at line 170 of file simd_dispatch.cpp.

◆ running_max()

double srfm::simd::BetaCalculator::running_max ( ) const
noexcept

◆ simd_level()

SimdLevel srfm::simd::BetaCalculator::simd_level ( ) const
noexcept

The documentation for this class was generated from the following files: