Commit Graph
55 Commits
Author SHA1 Message Date
Chip Hogg 78bcb3b019 Remove troublesome ::ratio members
For some reason, MSVC seems to want to instantiate these, even though
nobody ever asks for them (as evidenced by the fact that the builds
passed on other architectures).
2022-04-12 00:35:17 +00:00
Chip Hogg d19b2803ce Migrate units from ratio to Magnitude
This commit is huge, but hopefully the cognitive load is not too bad.
The bulk of this commit is just some fairly mechanical updates from
`ratio` to `Magnitude`.  Other things to call out:

- `UnitRatio` goes away.  We don't need this concept, because Magnitude
  can't even _represent_ anything that doesn't satisfy it.

- I commented out some formatting test cases where the precise
  expression changes, but the number is completely equivalent.  We will
  need to decide how we want to handle Magnitude formatting as a
  separate, follow-on task.  But at least Magnitude gives us all the
  tools we'll need to do so!
2022-04-11 15:16:16 +00:00
Mateusz Pusz 144f6951c0 style: all files refromatted with clang-format 2022-03-17 23:59:48 +01:00
Mateusz Pusz b1bd4cab2d feat: std::format support for compliant compilers added 2021-09-20 15:01:58 +02:00
Mateusz Pusz 46e1e5e932 refactor: US system renamed to USCS 2021-04-16 12:40:52 +02:00
Mateusz Pusz 8ca2b25349 fix: torque literal fixed + experimental_angle example refactored 2021-04-07 19:07:25 +02:00
Mateusz Pusz dfd209ed14 fix: femtotonne enabled 2021-04-02 18:57:17 +02:00
Mateusz Pusz 441db47928 fix: MSVC Release build fixed + pragmas usage refactored 2021-03-30 20:00:23 +02:00
Mateusz Pusz 8a26eaf420 fix: VS build fixed 2021-03-30 14:47:05 +02:00
Mateusz Pusz 37cfc53d1d refactor: IWYU applied to the source files
`alternative_namespaces` examples left out as I consider them a subject for removal in the nearest future.
2021-03-30 13:21:05 +02:00
Mateusz Pusz 1197fa1ec4 fix: MSVC shadowing warning disabled for fmt_unit_test.cpp 2021-03-19 23:31:36 +01:00
Mateusz Pusz fc7b0e44e2 feat: 💥 !data system renamed to isq::iec80000 (quantity names renamed too)
Relates to #253
2021-03-19 23:04:52 +01:00
Mateusz Pusz bbbb77286c refactor: physical replaced with isq
Refers to #249
2021-03-16 12:03:25 +01:00
Mateusz Pusz 4d965d7f47 fix: 💥 dim_torque now properly divides by an angle (instead of multiply) + default unit name change
Resolves #220
2021-02-15 15:01:56 +01:00
Mateusz Pusz 2a56438f1c refactor: file tree with systems defninitions refactored to limit ODR issues
Relates to #32 as with this commit we created something like modules for derived quantities
2020-09-11 18:11:25 +02:00
Mateusz Pusz 79558a6d72 refactor: systems defined in terms of SI moved under si namespace 2020-09-10 17:14:33 +02:00
Mateusz Pusz 9527b39005 refactor: 💥 q_* UDL renamed to _q_*
We had some fun exploring the STD UDLs for potential collisions,
we have learnt our lesson and know how to proceed.
Now is high time to start behaving and obeying C++ rules.
2020-09-09 19:20:35 +02:00
Mateusz Pusz d171f5451e NTTP ratio support added (resolves #49) 2020-06-27 19:15:46 +02:00
Mateusz Pusz ce301748dd Velocity renamed to Speed (resolves #103) 2020-05-10 17:31:47 +02:00
Mateusz Pusz 7e935a4108 Physical units put in the physical namespace (I am sorry) 2020-05-08 22:39:24 +02:00
rbrugo 9ec5c77602 Added molar heat capacity 2020-04-10 16:36:08 +02:00
rbrugo 7dda8319a2 Added molar energy 2020-04-10 16:36:08 +02:00
rbrugo 89dbc30a92 Added permeability 2020-04-10 16:36:08 +02:00
rbrugo 596161cca5 Added permittivity 2020-04-10 16:36:08 +02:00
rbrugo 1cf0074483 Added charge density 2020-04-10 16:36:08 +02:00
rbrugo 7803da0bdf Added electric field strength 2020-04-10 16:36:08 +02:00
rbrugo 15138286e5 Added thermal conductivity 2020-04-10 16:36:08 +02:00
rbrugo 017e88ca28 Added heat capacity and specific heat capacity 2020-04-10 16:36:08 +02:00
rbrugo 07b5364c97 Added dynamic viscosity 2020-04-10 16:36:08 +02:00
rbrugo 4b4cc70764 Added luminance 2020-04-10 16:36:08 +02:00
rbrugo 8ddd7e1233 Added concentration 2020-04-10 16:36:08 +02:00
rbrugo 15833669d8 Fixed text formatting for current density in unit test 2020-04-10 16:36:08 +02:00
rbrugo e6b34b6b1b Added current density 2020-04-10 16:36:08 +02:00
rbrugo 43f475fb80 Added absorbed dose 2020-04-10 16:36:08 +02:00
rbrugo 561773da7e Added catalytic activity 2020-04-10 16:36:08 +02:00
rbrugo 3cd77de2e9 Added conductance 2020-04-10 16:36:08 +02:00
rbrugo 14f00ef775 Added inductance 2020-04-10 16:36:08 +02:00
rbrugo 86eefe1b0d Added magnetic flux 2020-04-10 16:36:08 +02:00
rbrugo 608a75b61f Added magnetic induction unit tests 2020-04-10 16:36:08 +02:00
Ramzi Sabra 36bee5a8c3 fixed dot product symbol 2020-03-27 10:03:59 +01:00
Ramzi Sabra e0263c554d added ASCII character validation; added ASCII-only superscripts, scientific notation, dot product 2020-03-27 10:03:59 +01:00
Mateusz Pusz 6a5f25750d UDL naming refactored 2020-03-10 20:53:53 +01:00
Mateusz Pusz 0c02f94d29 Printing of uknown non-coherent units fixed 2020-02-24 20:45:47 +01:00
Mateusz Pusz e7756bf4eb Printing order of base units according to the recipe fixed 2020-02-24 15:18:37 +01:00
Oliver Schönrock 834d1fa09d extending the range of operator* for incoherent units with large num/den
this improves the situation for #55 (doesn't solve it outright)
motivating examples which now work are:
1q_mi * 1q_mi * 1q_mi
1q_au * 1q_au
tests added and docs updated
2020-02-20 23:46:55 +01:00
Oliver Schönrock 39a2c2de0e employing more mathemtaically correct ratio_gcd calc (for common ratio)
really finds the maximum common ration as opposed to previous algo which
simplified on the exp part of the ratio by using std::min
most of new code credit to Conor Williams
discussion and additional doc here:
https://github.com/mpusz/units/issues/62#issuecomment-588152833
test case was 1yd + 1in = 37in => added as a test
commenting out unusued ratio_add and its tests
if to be reintroduced, should also use the new gcd routines
additonal change was required to check in `safe_divisible` concept
den=1 is not sufficient anymore. reusing new gcd routines
moved ratio nomalize and new gcd routines into new, separate bits/ratio_maths.h
this resolves #62
2020-02-20 19:59:12 +01:00
Oliver Schönrock 1280b7d4be fix fmt test typos for accidental find/replace mistakes during 1m => 1q_m
changes
2020-02-20 19:57:20 +01:00
Mateusz Pusz 18620044c5 All UDLs are now prefixed with q_ 2020-02-17 15:56:06 +01:00
Mateusz Pusz 876c2ac426 thou used as a primary unit in a fmt unit test 2020-01-14 12:59:37 +01:00
Andy Little 024f5a9c83 change const order
move in,ft,fathom,ft2,ft3,mph from us to international namespace
TODO distinguish units with different names for same values
2020-01-12 21:34:36 +01:00