Commit Graph

153 Commits

Author SHA1 Message Date
Chip Hogg
b99faf051b Merge branch 'master' into chiphogg/mod#509 2024-11-13 08:41:52 -05:00
Mateusz Pusz
520610ab2f test: cartesian_vector used in cgs_test 2024-11-12 14:39:04 +01:00
Mateusz Pusz
0e7314e3a6 fix: math tests for inverse fixed after change in make_reference 2024-11-12 08:50:11 +01:00
Mateusz Pusz
8ec2f94ae2 fix: make_reference should skip only the exact kinds deduced from a unit 2024-11-11 23:36:58 +01:00
Chip Hogg
8a7483f7ea Add helpers for modular arithmetic
The prime-testing techniques we will use (Miller-Rabin, Strong Lucas)
all make heavy usage of modular arithmetic.  Therefore, we lay those
foundations here, adding utilities to perform the basic arithmetic
operations robustly.

Since these are internal-only helper functions, we don't bother checking
the preconditions, although we state them clearly in the contract
comment for each utility.  After C++26, we could add contracts for
these.

Helps #509.
2024-11-11 12:55:41 -05:00
Mateusz Pusz
b4810089ec fix: gcc-12 compilation fixed
Resolves #632
2024-11-09 23:02:12 +01:00
Mateusz Pusz
06853b7aeb fix: const was leaking to some SymbolicConstants 2024-11-08 12:57:29 +01:00
Mateusz Pusz
5097096915 test: lots of tests for complex quantities 2024-11-07 18:42:20 +01:00
Mateusz Pusz
da50348115 feat: 💥 RepresentationOf concept now also accepts a QuantitySpec and accepts any representation character for quantity kinds 2024-11-07 18:39:32 +01:00
Mateusz Pusz
75b50b8d2c feat: complex.h added 2024-11-07 10:58:51 +01:00
Mateusz Pusz
6896d8e086 fix: velocity is now defined in terms of displacement instead of position_vector 2024-11-06 18:46:01 +01:00
Mateusz Pusz
c7303cc5fb refactor: representation concepts refactored + some quantities switched to complex 2024-11-05 19:09:16 +01:00
Mateusz Pusz
2892fd83b0 test: more get_common_quantity_spec tests added 2024-11-05 08:06:45 +01:00
Mateusz Pusz
cc25f9b0de refactor: get_complexity refactored to returned maximum complexity of an element (instead of the sum of elements) 2024-11-04 19:13:48 +01:00
Mateusz Pusz
467d9a5558 refactor: get_complexity refactored to be 0-based and not account for a number of arguments in a list 2024-11-04 18:04:01 +01:00
Mateusz Pusz
73a003d0ef test: additional kind to quantity spec convertibility test added 2024-11-04 18:02:37 +01:00
Mateusz Pusz
f461cf479b test: test for lack of consitency between op+ and op+= for quantity_point 2024-11-04 09:41:11 +01:00
Mateusz Pusz
5810420277 refactor: 💥 tag types should not expose their members 2024-11-04 09:40:25 +01:00
Mateusz Pusz
26d2fc47f2 build: unit_tests_static_truncating restored for quantity_test and chrono_test 2024-10-30 15:00:03 +01:00
Mateusz Pusz
8ca8270d2f feat: from now on truncation is not allowed in compound assignment 2024-10-30 08:40:49 +01:00
Mateusz Pusz
18525beb31 test: small refactoring of compund assignment tests 2024-10-29 10:20:11 +01:00
Mateusz Pusz
63dc044dd8 fix: chrono_test.cpp is truncating 2024-10-29 09:37:58 +01:00
Mateusz Pusz
7445585db8 fix: compound assignment operations on quantities now behave the same as on the underying representation types
Resolves #137
2024-10-29 09:18:32 +01:00
Mateusz Pusz
9c7d3b0f95 fix: operator*(M, U u) fixed for U being scaled_unit 2024-10-25 12:07:57 +02:00
Mateusz Pusz
af18a6ba51 refactor: 💥 𝜋 replaced with π 2024-10-24 07:22:45 +02:00
Mateusz Pusz
10030c540b test: pow<0> and pow<1> tests added for dimensions 2024-10-20 21:08:42 +02:00
Mateusz Pusz
00847ab558 fix(tests): freestanding build fixed 2024-10-16 17:22:59 +02:00
Mateusz Pusz
b5ca8c78eb test: one kind_of test added to reference tests 2024-10-15 21:07:46 +02:00
Mateusz Pusz
21784b125e refactor: derived_quantity refactored to child_quantity 2024-10-15 21:06:52 +02:00
Mateusz Pusz
3eecdf3946 test: commutativity tests added to ISQ 2024-10-15 21:06:18 +02:00
Mateusz Pusz
820c7a5959 test: more std::chrono tests added 2024-10-15 21:04:52 +02:00
Mateusz Pusz
6591a65d06 feat: 𝜋 added as an alias for pi 2024-10-14 22:49:58 +02:00
Mateusz Pusz
195c3ad68b test: Unicode symbols used in unit tests 2024-10-10 00:12:43 +02:00
Mateusz Pusz
4eb63227e2 refactor: 💥 ascii -> portable, unicode -> utf8, 'A' -> 'P' 2024-10-10 00:02:08 +02:00
Mateusz Pusz
70a18fec0c refactor: 💥 op==(U1, U2) now checks for the same type (old behavior available as equivalent(U1, U2)) + convertible now verifies associated quantity_spec as well 2024-10-09 17:26:13 +02:00
Mateusz Pusz
2249879d62 feat: litre text symbol changed from l to L to avoid ambiguity with 1 2024-10-06 08:32:16 +02:00
Mateusz Pusz
cff9e25d3e feat: common_unit selection algorithm improved to make rev + rad return rad 2024-10-05 22:57:46 +02:00
Mateusz Pusz
569f27af8b fix: common_unit handling fixed for some corner cases 2024-10-05 17:52:52 +02:00
Mateusz Pusz
07e4e795c1 refactor: magnitude interface cleanup 2024-10-04 17:22:15 +02:00
Mateusz Pusz
f07e518ff0 test: unit tests for the inverse of mag_constant added 2024-10-04 14:59:39 +02:00
Mateusz Pusz
909d7d9065 docs: added TODO for radical powers of magnitude tests 2024-10-04 09:13:08 +02:00
Mateusz Pusz
dba8b07eb5 feat: added support for printing powers of magnitude constants 2024-10-03 19:36:37 +02:00
Mateusz Pusz
d783c3cda9 feat: magnitude text now obeys formatting parameters and knows how to print constants 2024-10-03 18:39:41 +02:00
Mateusz Pusz
5c1035a312 fix: extraneous space in unit symbol having only denominators removed 2024-10-03 18:34:37 +02:00
Mateusz Pusz
f3e1ace5f6 refactor(tests): usf alias provided in unit_symbol_test.h 2024-10-03 09:22:49 +02:00
Mateusz Pusz
eeece8a356 feat: scaled_unit does not have a priority over derived_unit anymore
We want `pow<2>(mag<3600> * second)` to print `[3600 s]^2` and `42 * (mag<10> * metre) / (mag<20> * second)` to print `42 [10 m]/[20 s]`
2024-10-02 16:10:29 +02:00
Mateusz Pusz
d7309c8602 feat: scaled_unit symbol printing improved ([] around the entire unit, small magnitude values do not use a power of 10 anymore) 2024-10-02 15:27:38 +02:00
Mateusz Pusz
25e99fe0fa feat: common unit symbols now use EQUIV{u1, u2, ...} syntax 2024-10-02 08:14:37 +02:00
Mateusz Pusz
fb8f67c68a refactor: 💥 all iec quantity specifications are now deprecated and moved to isq
IEC 80000-13 is a part of ISQ so quantity specifications should be in an `isq` namespace.
2024-09-28 15:06:22 +02:00
Mateusz Pusz
5a48f19746 feat: 💥 phase_velocity and group_velocity aliases removed from ISQ by ISO 2024-09-28 11:58:28 +02:00