27 double step_size) noexcept
29 , solver_(metric, step_size)
45FourVelocity GeodesicDeviationCalculator::estimate_velocity(
52 double norm = u.norm();
53 if (!std::isfinite(norm) || norm < std::numeric_limits<double>::epsilon() * 100.0) {
55 u = FourVelocity::Zero();
63double GeodesicDeviationCalculator::spatial_deviation(
68 double d1 = actual[1] - geodesic[1];
69 double d2 = actual[2] - geodesic[2];
70 double d3 = actual[3] - geodesic[3];
72 double sq = d1 * d1 + d2 * d2 + d3 * d3;
73 if (!std::isfinite(sq)) {
81std::vector<GeodesicSignal>
83 const std::vector<manifold::SpacetimeEvent>& events)
const noexcept
85 const std::size_t n = events.size();
96 std::vector<SpacetimePoint> actual_points;
97 actual_points.reserve(n);
98 for (
const auto& ev : events) {
99 actual_points.push_back(to_point(ev));
105 if (!std::isfinite(p[i]))
return false;
110 if (!all_finite(actual_points[0]) || !all_finite(actual_points[1])) {
112 std::vector<GeodesicSignal> result(n,
GeodesicSignal{0.0, 0.0,
false});
117 FourVelocity u0 = estimate_velocity(actual_points[0], actual_points[1]);
123 std::vector<GeodesicState> trajectory =
124 solver_.integrate(actual_points[0], u0,
static_cast<int>(n) - 1);
129 std::vector<GeodesicSignal> result;
132 for (std::size_t i = 0; i < n; ++i) {
136 bool valid = all_finite(actual) && all_finite(geodesic);
138 double deviation = 0.0;
140 deviation = spatial_deviation(actual, geodesic);
141 if (!std::isfinite(deviation)) {
std::vector< GeodesicSignal > compute(const std::vector< manifold::SpacetimeEvent > &events) const noexcept
GeodesicDeviationCalculator(const MetricTensor &metric, double step_size=constants::DEFAULT_GEODESIC_STEP) noexcept
Physical and financial constants for the SRFM system.
Geodesic Deviation Signal — AGT-07 public API.
static constexpr double DEFAULT_GEODESIC_STEP
Default proper-time step for geodesic integration.
Eigen::Vector< double, SPACETIME_DIM > FourVelocity
A tangent vector at a spacetime point (four-velocity: dx^μ/dτ).
Eigen::Vector< double, SPACETIME_DIM > SpacetimePoint
static constexpr int SPACETIME_DIM
Dimensionality of the financial spacetime manifold (1 time + 3 assets).
A point in 4D spacetime (t, x, y, z).