Commit Graph
306 Commits
Author SHA1 Message Date
Mateusz Pusz d0eceefe80 refactor: dead ratio code removed 2022-09-06 23:49:16 +02:00
Mateusz Pusz abc429a71a refactor: rotation angle unit renamed to revolution 2022-09-05 12:12:12 +02:00
Mateusz Pusz 1096d8d8ba fix: luminous flux support fixed 2022-09-01 12:18:18 +02:00
Mateusz Pusz e40a5d631c feat: solid angle support added 2022-09-01 12:16:47 +02:00
Mateusz Pusz a92a315bda feat: angular acceleration support added 2022-09-01 12:05:20 +02:00
Mateusz Pusz 1cb9d35d66 fix: radian_per_second unit symbol fixed 2022-09-01 12:02:45 +02:00
Mateusz Pusz 7719776711 feat: gradian support added 2022-09-01 10:48:34 +02:00
Mateusz Pusz 74f442d316 refactor: quantity_ratio removed as it is no longer used by the framework 2022-08-31 21:23:01 +02:00
Mateusz Pusz 8b534c8d8b feat: degrees and rotations support added
Resolves #370
2022-08-31 12:57:24 +02:00
Mateusz Pusz 1a29726d34 fix: math_test compile-time checks for floor, ceil, and round fixed
Relates to #311
2022-08-31 10:53:20 +02:00
Mateusz Pusz 1957e4424c docs: TODO comments cleanup in mixed system unit test files 2022-08-03 17:09:15 +02:00
Mateusz Pusz 0ebf85b9db fix: unknown_coherent_unit fixed 2022-08-01 11:59:00 +02:00
Johel Ernesto Guerrero Peña e988e1d74e refactor: update hacks for LLVM 16 2022-07-29 17:17:07 -04:00
Chip Hogg ea83af8aa9 Rename as_magnitude<...>() to mag<...>()
This is easier to write and to read.
2022-07-29 01:46:06 +00:00
Chip Hogg 7e591115fa Remove ratio's numerator() and denominator()
These have now become trivial.
2022-07-20 00:52:37 +00:00
Chip Hogg 7fd6913b73 Replace exp with 0 everywhere, and remove it
This lets us remove a ton of special-casing throughout the codebase, and
just generally makes things a lot simpler.

We also remove the ability to take rational powers of `ratio`, including
`sqrt` and `cbrt` helpers, because these are intrinsically ill-defined.

Fixes #369.
2022-07-20 00:52:37 +00:00
Chip Hogg 6a9dcb30de Migrate explicit-exp inputs 2022-07-20 00:52:36 +00:00
Chip Hogg ef9e6522ca Merge branch 'master' into chiphogg/switch-to-mag 2022-06-15 20:50:30 +00:00
Mateusz Pusz 9a6d6f9d2a fix: MSVC conversion issues fixed 2022-06-09 13:50:01 +02:00
Mateusz Pusz 46b3781743 Revert "refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols"
This reverts commit db09a065ab.
2022-05-24 14:20:17 +02:00
Mateusz Pusz 38fb9911a9 refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols 2022-05-24 12:56:14 +02:00
Mateusz Pusz db09a065ab refactor: 💥 ! " ⋅ " replaced with "⋅" in derived unit symbols 2022-05-24 12:48:07 +02:00
Mateusz Pusz 768f400cc3 test: quantity CTAD tests enabled only for the newest compilers 2022-05-23 09:56:45 +02:00
Mateusz Pusz 4498adce7c test: test for new quantity CTAD guide added 2022-05-22 19:49:10 +02:00
Mateusz Pusz 13f03bfe70 feat: luminous_flux support added 2022-05-13 14:31:13 +02:00
Chip Hogg 5fb468697b Merge branch 'master' into chiphogg/switch-to-mag 2022-05-12 16:12:01 +00:00
Mateusz Pusz 5300caf17b refactor: 💥 ! derived_deduced_unit renamed to derived_scaled_unit
Naming is hard ;-)
2022-05-11 12:34:52 +02:00
Mateusz Pusz 32b36fb670 refactor: 💥 ! PrefixFamily support removed
It doesn't have much sense to restrict prefixes usage for most units and in many places we were wrong to do so already.
2022-05-11 11:59:33 +02:00
Mateusz Pusz 0522bae972 refactor: 💥 ! unit renamed to derived_unit 2022-05-11 11:40:19 +02:00
Mateusz Pusz f5d21a0711 refactor: 💥 ! derived_unit renamed to derived_deduced_unit 2022-05-11 11:23:18 +02:00
Mateusz Pusz 4c60447a28 Merge branch 'master' into downcast_mode_off 2022-05-09 19:12:02 +02:00
Mateusz Pusz ffa0f321f9 fix: shadowing compilation errors on MSVC fixed 2022-05-06 10:00:39 +02:00
Mateusz Pusz 4361cb874e fix: hectare definition fixed to be a prefixed version of are + other units
Relates to #359
2022-04-27 19:32:21 +02:00
Mateusz Pusz 56cee31a67 fix: si::hep::dim_momentum duplicated definition fixed 2022-04-24 19:52:07 +02:00
Chip Hogg 2b37bc7b3e Address review feedback 2022-04-19 15:42:43 +00:00
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 5e365f1905 Delete obsolete test case 2022-04-11 15:16:16 +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
Chip Hogg d7681e188e Support seamless interop between ratio and rational Magnitude
We provide two new functions, `numerator(m)` and `denominator(m)`, for a
Magnitude `m`.  They fulfill the following conditions:

1. `numerator(m)` and `denominator(m)` are always integer Magnitudes.
2. If `m` is rational, then `m == numerator(m) / denominator(m)`.

If `m` is _not_ rational, then the numerator and denominator are not
especially meaningful (there is no uniquely defined "leftover irrational
part").  However, we choose a convention that matches how humans would
write a mixed number.  For example, sqrt(27/16) would have a numerator
of 3, denominator of 4, and a "leftover part" of sqrt(3), matching the
"human" way of writing this as [(3 * sqrt(3)) / 4].  This has no use
yet, but it may later be useful in printing the Magnitude of an
anonymous Unit for end users.

To further reduce friction for the upcoming migration, we provide an
implicit conversion from a Magnitude to a `ratio`.  We restrict this
operation to rational Magnitudes, and guard this with a `static_assert`.
2022-04-05 23:03:44 +00:00
Mateusz Pusz b221dace3f style: clang-format applied to the remaining files 2022-04-02 21:36:42 +02:00
Markus Hofbauer cf7a7ed17a check: run pre-commit on all files 2022-04-02 18:58:23 +02:00
Johel Ernesto Guerrero Peña 146f1d1c83 fix: improve downcast mode off 2022-03-28 10:58:02 -04:00
Mateusz Pusz 63f3dd2be6 Merge pull request #344 from JohelEGP/quotient_remainder_theorem
test(static): simplify quotient_remainder_theorem test cases
2022-03-22 10:04:49 +01:00
Johel Ernesto Guerrero Peña feb1a0b860 test(static): simplify quotient_remainder_theorem test cases 2022-03-21 14:29:50 -04:00
Mateusz Pusz 3729a9fe93 Merge pull request #337 from chiphogg/chiphogg/prime-wheel
Use wheel factorization for prime numbers
2022-03-21 10:37:05 +01:00
Chip Hogg c339383873 Convert names to standard_case 2022-03-19 16:07:39 +00:00
Chip Hogg 48b6280486 Merge branch 'master' into chiphogg/prime-wheel 2022-03-19 16:01:32 +00:00
Chip Hogg a99e5f9032 Switch tests to use top-level, anonymous namespace 2022-03-19 15:54:29 +00:00
Chip Hogg 28c4fe3c08 Run clang-format-15 on changed files 2022-03-19 14:29:11 +00:00
Chip Hogg 1e8460d401 Revert "Try upping the basis size further"
This reverts commit 87073856a7.
It didn't fix the problem, and it caused some new ones.  We need a
different approach.
2022-03-19 13:21:47 +00:00