Mateusz Pusz
b2423bfded
feat: quantities can now be multiplied and divided by units
2023-09-29 21:40:24 -06:00
Mateusz Pusz
caf0e66cb2
test: more unit tests for unit conversions
2023-09-28 09:01:52 +02:00
Mateusz Pusz
94bd2a23ca
build: got rid of old gcc hacks
2023-09-26 18:25:03 +02:00
Mateusz Pusz
bfbc1785b8
feat: isq::activity added and becquerel definition updated to benefit from it
2023-09-26 10:37:08 +02:00
Mateusz Pusz
2e26eed59d
feat: numerical_value_ref_in disallowed for rvalues
2023-09-13 19:59:49 +02:00
Mateusz Pusz
1c7928021d
feat: force_in(U) support added
2023-09-13 10:18:07 +02:00
Mateusz Pusz
a7711cb301
refactor: quantity::value() refactored to quantity::value_ref_in(U)
2023-09-13 09:23:59 +02:00
Mateusz Pusz
b6bc9434d0
fix: quantity.in(U) fixed to clone a reference from the source type
2023-09-04 12:27:49 +02:00
Mateusz Pusz
2bfc282483
test: missing units tests for quantity::one() aded
2023-08-31 19:01:13 +02:00
Mateusz Pusz
f1c2c74ab0
refactor: quantity::value() renamed to quantity::numerical_value()
...
According to https://jcgm.bipm.org/vim/en/1.19.html "quantity value" also contains a unit. According to https://jcgm.bipm.org/vim/en/1.20.html "numerical value" is the correct term for just a number.
Resolves #423
2023-08-30 11:30:35 +02:00
Mateusz Pusz
624b7c7404
fix: some fixes revealed during clang compilation
2023-08-24 19:14:23 +02:00
Mateusz Pusz
a9204e2473
refactor: number() and number_in() renamed to value() and value_in()
...
Resolves #423
2023-08-23 17:15:32 +02:00
Mateusz Pusz
ae92b49775
refactor: op[U] for quantity and quantity_point replaced with .in(U)
...
Resolves #469
2023-08-23 16:46:15 +02:00
Mateusz Pusz
110986ee1f
feat: quantity_cast<kind_of_qs>(associated_unit) now returns the bare unit as a reference
2023-08-18 11:11:29 +02:00
Mateusz Pusz
571bf47b95
test: quantity_test cleanup
2023-08-01 12:01:12 +02:00
Mateusz Pusz
a6e4851efe
test: more binary operators tests added for quantity
2023-08-01 12:00:35 +02:00
Mateusz Pusz
5d73cd0730
feat: dimensionless quantities with a unit one are not special anymore
2023-07-10 16:53:49 +02:00
Mateusz Pusz
ba1f58af76
refactor: All the macros refactored to have MP_UNITS_ prefix
2023-06-21 18:05:21 +02:00
Mateusz Pusz
7774466c1c
fix: clang-17 specific compilation fixes (partially contributed by @JohelEGP)
2023-06-16 14:54:22 +03:00
Mateusz Pusz
52ab3f1535
refactor: SI units do not depend on the entire ISQ anymore + header dependency compilation fixes
2023-06-15 14:37:22 +03:00
Mateusz Pusz
a6434e6b60
test: some checks from the old v2_framework example moved to proper unit tests
2023-06-05 11:12:34 +02:00
Mateusz Pusz
52bbd00ab4
style: clang-format new rules applied to the code base
2023-05-26 14:20:00 +02:00
Mateusz Pusz
7d9ae3ec31
refactor: mp_units subdirectory renamed to mp-units
2023-05-25 12:47:10 +02:00
Mateusz Pusz
2bb8e4e739
test: quantity tests updated
2023-04-21 15:22:14 +01:00
Mateusz Pusz
7ef8193dfc
fix: modulo operation logic fixed
2023-04-10 19:46:50 +02:00
Mateusz Pusz
40f6ae2da7
refactor: quantity refactored + quantity_test updated to reflect and test changes
2023-04-05 17:24:08 +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
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
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
Chip Hogg
5fb468697b
Merge branch 'master' into chiphogg/switch-to-mag
2022-05-12 16:12:01 +00: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
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
b221dace3f
style: clang-format applied to the remaining files
2022-04-02 21:36:42 +02:00
Johel Ernesto Guerrero Peña
146f1d1c83
fix: improve downcast mode off
2022-03-28 10:58:02 -04:00
Johel Ernesto Guerrero Peña
feb1a0b860
test(static): simplify quotient_remainder_theorem test cases
2022-03-21 14:29:50 -04:00
Johel Ernesto Guerrero Peña
3f145a25db
refactor: update hacks for LLVM 15
2022-02-07 21:07:22 -04:00
Johel Ernesto Guerrero Peña
4efed3c6d4
refactor: update Clang 14 to not require range-v3 ( #321 )
...
* Revert "refactor: update hacks for LLVM 14"
This reverts commit d142844de7 .
* refactor: update Clang 14 to not require range-v3
2021-12-13 10:01:16 +01:00
Mateusz Pusz
ca3d111579
fix: CTAD test disabled for most of the compilers
2021-10-20 20:18:15 +02:00
Mateusz Pusz
240ec3a460
build: CTAD for quantity is not supported by clang
2021-10-20 19:58:31 +02:00
Mateusz Pusz
b7b8a0bf93
fix: CTAD for aliases fixed
2021-10-20 18:52:13 +02:00
Mateusz Pusz
120d863c40
test: derived_quantity-related compilation error fixed
2021-09-09 09:26:23 +02:00
Ralph J. Steinhagen
322cde70b9
added HEP specific units and definitions
...
in accordance with https://www.bipm.org/documents/20126/41483022/SI-Brochure-9.pdf#page=147
see also disccusion thread #292
2021-08-03 10:56:47 +02:00
Ralph J. Steinhagen
8e1539bf22
added inheritance unit-test and made is_quantity<T> more specific
2021-06-29 20:31:06 +02:00
Mateusz Pusz
1783d243da
fix: quantity modulo arithmetics fixed
...
Resolves #231
2021-05-11 15:03:04 +02:00
Mateusz Pusz
6d39459cbc
perf: rvalue references support added for constructors and getters
...
Resolves #275
2021-05-03 19:44:50 +02:00