Commit Graph
49 Commits
Author SHA1 Message Date
Mateusz Pusz 8b534c8d8b feat: degrees and rotations support added
Resolves #370
2022-08-31 12:57:24 +02:00
Markus Hofbauer cf7a7ed17a check: run pre-commit on all files 2022-04-02 18:58:23 +02:00
Chip Hogg 04b80f0827 Use wheel factorization for prime numbers
Certain existing units in the library require very large prime
numbers---so large, in fact, that our naive trial division hits the
_iteration limit_ for `constexpr` loops.  We don't want to force users
to provide a compiler option override, so we'd better find another way.

The solution is to use the "wheel factorization" algorithm:
https://en.wikipedia.org/wiki/Wheel_factorization

This lets us skip most composite numbers in our trial division.  The
implementation presented here is configurable in terms of the size of
the "basis" of primes we use.  Bigger bases let us skip more primes, but
at the cost of storing more numbers.  Fortunately, it turns out that N=3
was good enough for our purposes.
2022-03-10 23:29:02 +00:00
Mateusz Pusz f9fb6cc8b3 build: projectPrefix usage added 2021-11-05 23:35:30 +01:00
rstein cc5318e5cc refactored HEP units into separate files and corrected namespace where necessary 2021-08-04 13:46:48 +02:00
Johel Ernesto Guerrero Peña 80eefec97c fix: add quantity_point::origin, like std::chrono::time_point::clock 2021-06-29 20:44:27 +02:00
Mateusz Pusz 2c8c6c2e98 refactor: quantity cration helpers are not opt-out rather than opt-in
Resolves #277
2021-05-09 15:52:20 +02:00
Mateusz Pusz 70bff31d06 feat: quantity aliases support addded 2021-04-15 19:13:25 +02:00
Mateusz Pusz b982921d27 refactor: References are now guarded UNITS_REFERENCES with (ON by default) + examples duplicated to subdirectories
Now References can be disabled to meassure a compile time impact. Also the same examples are now provided in two subdirectories to be able to easily compare the pros and cons of every quantity construction technique.
2021-04-06 15:57:28 +02:00
Mateusz Pusz c3659dbb47 refactor: UNITS_UDLS renamed to UNITS_LITERALS
Also now the existence of the preprocessor flag is enough to trigger the feature (`#ifdef` instead of `#if`)
2021-04-06 13:33:27 +02:00
Mateusz Pusz 1a5b4fc85e refactor: UDLs support switched off by default 2021-04-02 18:56:28 +02: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
Johel Ernesto Guerrero Peña c61b8643d7 refactor(test): rename references.cpp to references_test.cpp
Addresses https://github.com/mpusz/units/pull/261#discussion_r597217632.
2021-03-18 22:37:25 +01:00
Johel Ernesto Guerrero Peña ed94ba347f refactor(test): rename unit_constants.cpp to references.cpp
Addresses https://github.com/mpusz/units/pull/261#discussion_r597137577.
2021-03-18 22:37:25 +01:00
Mateusz Pusz 221883bb25 build: core library and each system separated to dedicated CMake targets
Refers to #249
2021-03-16 23:05:45 +01:00
Mateusz Pusz 625f452daa build: libc++ support added 2021-03-15 21:11:26 +01:00
Mateusz Pusz 02ea4825e8 docs: Compilation warnings handling refactored 2021-02-17 15:45:30 +01:00
Johel Ernesto Guerrero Peña 6bf09aa646 feat: quantity_kind and quantity_point_kind 2021-02-15 19:31:08 +01:00
Mateusz Pusz 8f04bd9cfe build: mp::units CMake target was a bad idea -> mp-units::mp-units is back 2021-02-15 17:06:09 +01:00
Johel Ernesto Guerrero Peña efeacca9ee fix: restore user-warnings within the library implementation 2021-02-06 21:20:31 +01:00
Mateusz Pusz ba37c37abd fix: MSVC compilation fixed 2021-01-06 19:06:09 +01:00
Mateusz Pusz f4ff02f8e5 fix: quantity's compound operators fixed to behave like ints do 2021-01-06 16:44:32 +01:00
Johel Ernesto Guerrero Peña 8dede0db9f feat: unit_constants 2020-12-28 12:20:54 +01:00
Mateusz Pusz a172f34684 build: Minimum CMake version required set for each file based on its contents 2020-12-21 22:56:00 +01:00
Mateusz Pusz 206712f046 build: Library renamed to mp::units 2020-12-17 23:06:37 +01:00
Mateusz Pusz 2dd8c90250 feat: ✨ interoperability with std::chrono::duration and other units libraries
Resolves #33
2020-10-07 12:02:08 +02:00
Mateusz Pusz cfc90f4aac refactor: 💥 basic_concepts, quantity and quantity_cast refactored
BREAKING CHANGE:  ScalableNumber renamed to QuantityValue

Resolves #107
2020-10-06 18:17:52 +02:00
Mateusz Pusz 32779e01f0 Build system refactored to be comatible with ConanCenter 2020-09-06 00:00:06 +02:00
Johel Ernesto Guerrero Peña 75119eef3f feat: quantity_point 2020-06-17 15:31:22 +02:00
Mike Ford 8230a42cb0 added some units for the foot-pound-second system and the static tests 2020-06-16 15:14:46 +02:00
Mateusz Pusz f5df68253e symbol_text refactored 2020-03-27 15:21:05 +01:00
Mateusz Pusz 2a77e20cc6 Unit test renamed 2020-03-27 10:08:19 +01:00
Ramzi Sabra 60d9a9036a added more operators; added tests 2020-03-27 10:03:59 +01:00
Mateusz Pusz ab1cc4b8e7 Overconstrained quantity operations relaxed 2020-03-25 15:04:33 +01:00
Mateusz Pusz 0a906450a2 Custom representation tests moved to a new file 2020-03-24 22:56:11 +01:00
Mateusz Pusz 81b1ba3162 fixed_string_test added 2019-12-26 09:49:39 +01:00
Mateusz Pusz 2abe429ba7 dimensions_concepts_test added 2019-12-17 22:26:01 +01:00
Mateusz Pusz 80a13b1a94 US system isolated from SI 2019-12-17 12:29:19 +01:00
Mateusz Pusz 12b67923bc CGS tests added 2019-12-11 16:20:08 +01:00
Mateusz Pusz 8ffc46ba75 CGS support added 2019-12-09 17:19:58 +01:00
Mateusz Pusz 2c29af9670 Custom unit and data tests enabled 2019-12-07 18:33:55 +01:00
Mateusz Pusz 22eda11bea More refactoring
- unknown_unit and unknown_dimension added
- the support for remaining SI units added
2019-12-07 16:30:40 +01:00
Mateusz Pusz 33f14f39f3 math_test enabled 2019-12-06 12:56:44 +01:00
Mateusz Pusz c48bfe2098 quantity refactored and quantity_test enabled 2019-12-04 17:46:19 +01:00
Mateusz Pusz 0986d1e812 dimension_test enabled 2019-12-01 20:00:08 +01:00
Mateusz Pusz fa9b7db9d5 type_list_test enabled 2019-12-01 19:56:23 +01:00
Mateusz Pusz 1b4e8a2127 Units and dimensions redesigned 2019-12-01 19:47:58 +01:00
Mateusz Pusz e846d40a33 CGS test added 2019-11-02 13:59:11 +01:00
Mateusz Pusz 3475f5193e Catch2 support added (resolves #8) 2019-10-14 10:53:02 +02:00