Compute β_i = |velocities[i]| / running_max for every element.
Compute β_i = |velocities[i]| / running_max for every element.running_max is updated monotonically across successive calls: it equals max(running_max_in, max(|velocities[i]|)). Pass running_max=0.0 on the first call.
The selected SIMD kernel processes blocks of 8 (AVX-512) or 4 (AVX2) doubles per cycle; tail elements use the scalar fallback.
- Parameters
-
| velocities | Raw price velocities (any finite double, arbitrary sign). |
| running_max | Current session maximum |velocity|; updated in-place. |
- Returns
- One BetaVelocity per input velocity, in order. Empty vector when velocities is empty.
Panics
This function never panics.
double rmax = 0.0;
std::vector< srfm::momentum::BetaVelocity > computeBetaBatch(const std::vector< double > &velocities, double &running_max) noexcept
#pragma once
#include <vector>
struct SimdGammaCompute {
make(
double gamma_val)
noexcept {
}
};
[[nodiscard]] std::vector<srfm::momentum::BetaVelocity>
double& running_max) noexcept;
[[nodiscard]] std::vector<srfm::momentum::LorentzFactor>
class BetaCalculator {
public:
[[nodiscard]] std::vector<srfm::momentum::BetaVelocity>
[[nodiscard]] std::vector<srfm::momentum::LorentzFactor>
const std::vector<srfm::momentum::BetaVelocity>& betas) noexcept;
private:
double running_max_{ 0.0 };
};
}
Pre-computed Lorentz factor γ = 1/√(1−β²). Always ≥ 1.0.
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.
std::vector< srfm::momentum::BetaVelocity > computeBetaBatch(const std::vector< double > &velocities) noexcept
Compute β_i = |v_i| / running_max for a batch of velocities.
SimdLevel simd_level() const noexcept
Returns the SIMD level selected for this process.
double running_max() const noexcept
Returns the current running maximum (read-only).
BetaCalculator() noexcept
Construct a fresh calculator. running_max starts at 0.0.
Runtime SIMD capability detection for the SRFM acceleration layer.
std::vector< srfm::momentum::LorentzFactor > computeGammaBatch(const std::vector< srfm::momentum::BetaVelocity > &betas) noexcept
Compute γ_i = 1/√(1 − β_i²) for every element.
SimdLevel
Ordered enumeration of SIMD capability tiers.
@ SCALAR
No SIMD; pure scalar C++ path.
Momentum-Velocity Signal Processor (AGT-03 / SRFM)
static srfm::momentum::LorentzFactor make(double gamma_val) noexcept