C++ Logo

std-proposals

Advanced search

Re: [std-proposals] On the standardization of mp-units P3045R1

From: Gašper Ažman <gasper.azman_at_[hidden]>
Date: Tue, 18 Jun 2024 16:25:22 +0100
Affine spaces are absolutely required and also are, by necessity of,
you know, actually having to model them with numbers, a /tad/
different than in math.

In math, an affine space's point space _truly_ doesn't have an origin
(or "epoch"). In CS, we must choose an origin, to be able to represent
points in memory. This origin then becomes a useful thing; and in
fact, most _actual_ point-spaces actually have an origin that's not
arbitrary (degrees Celsius, Kelvin, degres Fahrenheit, UNIX timestamp,
etc.).

The fact that we often don't use such rigor when discussing physics
does't mean such rigor isn't at the bottom of every actual theory, but
that it's so "obvious" that we forget that we're using the same term
for two different things. Programming just doesn't have this luxury,
because _not confusing the two meanings_ is the whole point of a units
library (check your math).

Affine spaces are foundational, and all point-spaces have an origin.
Anyone trying to "simplify" this down to just vector spaces is
actually complectifying and reducing the usefulness of the library to
express proofs.

I'm strongly for keeping things separate; and perhaps some renaming
might be in order, but that's about it.


On Tue, Jun 18, 2024 at 4:18 PM Mateusz Pusz via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> All quantity_points do have an "epoch". However, to simplify the interfaces we allowed the epochs to be implicit in some cases.
>
> More info here:
> - https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3045r1.html#zeroth_point_originquantityspec
> - https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3045r1.html#temperature-support
>
> wt., 18 cze 2024 o 17:16 Ville Voutilainen <ville.voutilainen_at_[hidden]> napisał(a):
>>
>> On Tue, 18 Jun 2024 at 18:09, Mateusz Pusz <mateusz.pusz_at_[hidden]> wrote:
>> >
>> > Actually, the opposite ;-) (which is consistent with chrono).
>> >
>> > More info here: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3045r1.html#operations-in-the-affine-space.
>>
>> Ah, yes, chrono types have an epoch. These types.. ..don't. But maybe
>> temperatures could/should.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-06-18 15:25:36