Commit Graph

18 Commits

Author SHA1 Message Date
Mateusz Pusz ce833d344d refactor(utility): deprecate the mp_units:: rep shims and migrate consumers
The cartesian_vector and random distribution types now live in
mp_units::utility. Turn the transitional mp_units:: shims into proper
[[deprecated]] aliases (gcc-12 keeps a plain using-declaration because
CTAD through a deprecated alias template is broken there), and migrate
all in-tree consumers to mp_units::utility:: so the deprecations don't
trip -Werror. cartesian_tensor keeps no shim: it is unreleased (added in
2.6.0, never shipped), so it lives only at mp_units::utility.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 18:55:19 +02:00
Mateusz Pusz e061bf0ef8 refactor(representation): replace disable_real/NotQuantity with disable_representation
Consolidate the representation opt-outs into one character-agnostic customization
point and align the documentation with the two-axis model.

- Add `disable_representation<T>` in `customization_points.h`: a specializable
  opt-out that bars a type from being a quantity representation regardless of
  character. Its default (`is_quantity_abstraction<value_type_t<T>>`) rejects a
  quantity or quantity-like type, and any container of them; `bool` is opted out
  explicitly. This retires both `disable_real` and the `NotQuantity` guard.
- Rename the internal predicate `is_quantity_like` -> `is_quantity_abstraction`
  (it covers `Quantity || QuantityLike`) so it no longer collides with the
  `QuantityLike` customization family.
- The representation tier now leads with one shared `RepresentationBaseline`
  guard (not opted out + `UnitMagnitudeScalable`), which short-circuits a quantity
  before any character concept instantiates its operators (avoiding a
  satisfaction cycle).
- Docs: restructure `representation_types.md` around the two character axes
  (field via `numeric_field`, order via `tensor_order`) with a common baseline,
  the new `disable_representation` section, and consistent unit-magnitude-aware
  scaling terminology; align `concepts.md` and `using_custom_representation_types.md`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 21:36:07 +02:00
Mateusz Pusz 703235d1d4 refactor(representation): intrinsic order/field traits and two-tier character concepts
Replace the `disable_vector`/`disable_tensor` opt-outs with intrinsic,
adapter-overridable traits and split representation classification into two tiers.

- `customization_points.h` now owns the customizable surface: the `real`/`imag`/
  `modulus` CPOs plus the `numeric_field` (field axis) and `tensor_order` (order
  axis) traits. Adapters specialize these; the derived concepts stay with the
  rest of the concept model in `representation_concepts.h`.
- `numeric_field` is the single source of truth for the field axis (default:
  `real()`/`imag()` API detection). Field matching is exact and disjoint - a real
  quantity needs a real representation and a complex one a complex representation.
- `tensor_order` is detected structurally (two-index access -> 2, one-index -> 1,
  otherwise 0) and overridable. Order matching is rank-ordered: a lower-order
  representation fills a higher-order slot.
- Character concepts (`Real`/`Complex`, rank-ordered `Scalar`/`Vector`/`Tensor`)
  carry no representation-validity, so in V3 they can also classify a quantity by
  its character. The `*Representation` concepts are `NotQuantity`-first + character
  + `UnitMagnitudeScalable`; leading with `NotQuantity` rejects a quantity before
  its operators are instantiated, avoiding a constraint-satisfaction cycle.
- Eigen/Blaze adapters declare `numeric_field` from their element type (they expose
  `real()`/`imag()` on real types too, which the API default would misread as complex).
- Rename `MagnitudeScalable` -> `UnitMagnitudeScalable` and `UsesMagnitudeAwareScaling`
  -> `UsesUnitMagnitudeAwareScaling` to disambiguate scaling by a `unit_magnitude`
  from the value/L2 magnitude (the `magnitude` CPO).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 19:17:05 +02:00
Mateusz Pusz dd5854a965 refactor(test): drop the legacy character enum from the test suite
Replace `using enum quantity_character_legacy` plus bare character names in the ISQ/HEP
tests with local `quantity_character` constants (`scalar`, `complex_scalar`, `vector`,
`tensor`) built from `quantity_tensor_order` / `quantity_field`, and switch the
`RepresentationOf` / `QUANTITY_SPEC_` character arguments in the concept and quantity-spec
tests to the bare-axis spelling. `real_scalar` is renamed to `scalar` for consistency with
the order-named constants. `apparent_power` (derived from the complex `complex_power`)
pins `quantity_field::real`, matching the library definition.

This removes the final legacy-enum usage from the repository.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 00:10:20 +02:00
Mateusz Pusz 5c8c4ad5ae feat: external linear algebra libraries integrations added + quantity::magnitude() member function
Resolves #301
2026-06-22 18:51:56 +02:00
Mateusz Pusz 35798a0f39 refactor: ostream.h header file made deprecated 2025-06-20 10:40:10 +02:00
Mateusz Pusz 50c05bddb3 refactor: format.h header file made deprecated 2025-06-20 09:06:49 +02:00
Mateusz Pusz 47a82f466c refactor: scalar and complex renamed to real_scalar and complex_scalar respectively + concepts refactoring + electromagnetism fixes 2025-02-11 17:26:19 +01:00
Mateusz Pusz 465f88d500 refactor: 💥 is_XXX customization points for representation types removed 2024-11-26 14:48:08 +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 2e840cfdb4 refactor: Repetitive inline constexpr removed as no longer needed
Not needed anymore as stated in cplusplus/draft#4601
2024-09-05 08:43:36 +02:00
Mateusz Pusz b870b85c25 feat: import std; support added
Resolves #595
2024-07-16 17:36:00 +02:00
Mateusz Pusz 0fbe0bb5e0 style: clang-format 2024-06-10 22:13:37 +02:00
Mateusz Pusz e90cffcbda refactor: text formatting library header files are no longer included in compat_macros.h 2024-06-10 22:04:41 +02:00
Mateusz Pusz 8ea346be1c refactor: 💥 header files with the entire system definitions moved up in the directory tree 2024-04-25 16:34:11 +02:00
Mateusz Pusz c066104af7 refactor: 💥 framework.h introduced + IWYU 2024-04-24 21:09:29 +02:00
Mateusz Pusz fb8552b1d9 refactor: core-fmt and core-ostream modules merged with core 2024-01-06 08:51:01 +01:00
Mateusz Pusz 0eaf6e2e56 refactor: modules support redesigned 2024-01-06 08:51:01 +01:00