space::irbem::T89PositionFold
cheatah-space v0.1.0-alpha — Biome Standard 0.6.5-alpha
The batch's position caveat, accumulated one point at a time.
A batch returns ONE Status for N points, so it can only be the worst of them — and it must not be better than the worst, or a caller who checks it learns nothing about the point that was wrong. Computing that honestly must not cost a second pass over the positions: at 2^22 points the input is 100 MB and re-reading it is a measurable fraction of the whole call. So this folds into the loop that is already touching each point, and it does so without a sqrt: T89's envelope is a radius band plus a sunward x bound, all three monotone, so the smallest radius, the largest radius and the smallest x decide the entire batch and the radii can be compared as SQUARES. Two check_position calls per CALL then reproduce exactly what N of them would have said.
IrbemT89.BatchReportsTheSameEnvelopeTheScalarLaneDoesFunctions
Fold one position in.
p | the position, GSM, in Earth radii. |
O(1) — one fused radius, three comparisons, no sqrt and no branch that a compiler cannot turn into a select.
none.
IrbemT89.BatchReportsTheSameEnvelopeTheScalarLaneDoesWhat the batch's positions say about the model's envelope.
Status::DomainError when any point is not finite or is inside the Earth, Status::OutOfValidityRange when any point is outside T89's published r_GEO <= 70 R_E, otherwise Status::Ok.
O(1) — two square roots and two envelope lookups for the whole batch.
none.
IrbemT89.BatchReportsTheSameEnvelopeTheScalarLaneDoesConstants & variables
The smallest r^2 seen, R_E^2; +inf until the first point.
The largest r^2 seen, R_E^2; zero until the first point.
The smallest GSM x seen, R_E; +inf until the first point.
False once any point has had a non-finite coordinate.
Tracked separately because a NaN radius compares false against everything and would otherwise slip through both extremes.
