cheatah
Struct

space::irbem::Om97PositionFold

cheatah-space v0.1.0-alpha — Biome Standard 0.6.5-alpha

The batch's position caveat, accumulated one point at a time.

One Status for N points can only be the worst of them, and computing it must not cost a second pass over the positions. The fitted box is three monotone bounds — a minimum radius, a maximum SM cylindrical radius, a maximum |z_SM| — so the extremes decide the batch, and they are folded as SQUARES (radius and cylindrical radius) so there is no per-point sqrt. The SM z is one fused multiply-add from the tilt's sine and cosine, and rho_SM^2 = r^2 - z_SM^2 because a rotation preserves r.

Unit testIrbemOm97.BatchReportsTheSameEnvelopeTheScalarLaneDoes

Functions

fn void add(const Position< Frame::GSM > &p) #

Fold one position in.

Parameters
p

the position, GSM, in Earth radii.

Complexity

O(1) — one fused radius, one rotation component, four comparisons, no sqrt.

Allocation

none.

Unit testIrbemOm97.BatchReportsTheSameEnvelopeTheScalarLaneDoes
fn Status verdict() const #

What the batch's positions say about the model's envelope.

Returns

Status::DomainError when any point is not finite or is inside the Earth, Status::OutOfValidityRange when any point is outside the paper's fitted box, otherwise Status::Ok.

Complexity

O(1) — two square roots and two envelope checks for the whole batch.

Allocation

none.

Unit testIrbemOm97.BatchReportsTheSameEnvelopeTheScalarLaneDoes

Constants & variables

var double sin_tilt #

sin(psi) for the batch's epoch; zero tilt until the batch sets it.

var double cos_tilt #

cos(psi) for the batch's epoch; zero tilt until the batch sets it.

var double r2_lo #

The smallest r^2 seen, R_E^2; +inf until the first point.

var double rho2_hi #

The largest rho_SM^2 seen, R_E^2; zero until the first point.

var double abs_z_hi #

The largest |z_SM| seen, R_E; zero until the first point.

var bool finite #

False once any point has had a non-finite coordinate.

Tracked separately because a NaN compares false against everything and would otherwise slip through every extreme.