refactor: systems defined in terms of SI moved under si namespace
This commit is contained in:
1 parent
7d204a1177
commit
79558a6d72
124 files changed
+580
-587
No files matched your search
+47
-47
@@ -143,54 +143,54 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/acceleration.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/energy.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/force.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/mass.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/power.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/pressure.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/cgs/time.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/acceleration.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/density.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/energy.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/force.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/mass.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/power.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/pressure.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/time.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/fps/volume.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/iau/length.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/imperial.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/imperial/length.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/international/volume.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/constants.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/dimensions.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/natural/units.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/acceleration.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/energy.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/force.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/mass.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/power.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/pressure.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/cgs/time.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/dimensions_and_concepts.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/acceleration.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/density.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/energy.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/force.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/mass.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/power.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/pressure.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/time.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/fps/volume.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/iau/length.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/imperial/length.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/area.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/speed.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/international/volume.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/si.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/absorbed_dose.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/acceleration.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/area.rst"
|
||||
@@ -234,11 +234,11 @@ add_custom_command(OUTPUT "${SPHINX_INDEX_FILE}"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/voltage.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/volume.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/typographic.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/typographic/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/typographic/length.rst"
|
||||
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/us.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/us/length.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us.rst"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/reference/systems/physical/si/us/length.rst"
|
||||
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/references.rst"
|
||||
|
||||
|
||||
@@ -10,14 +10,15 @@ Library Directories Structure
|
||||
│ └── external
|
||||
├── data
|
||||
└── physical
|
||||
├── cgs
|
||||
├── iau
|
||||
├── imperial
|
||||
├── international
|
||||
├── natural
|
||||
├── si
|
||||
├── typographic
|
||||
└── us
|
||||
└── si
|
||||
├── cgs
|
||||
├── fps
|
||||
├── iau
|
||||
├── imperial
|
||||
├── international
|
||||
├── typographic
|
||||
└── us
|
||||
|
||||
- *./units*
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ be calculating the average speed based on provided distance and duration
|
||||
quantities. The usage of such a function can look as follows::
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::physical::international::literals;
|
||||
using namespace units::physical::si::international::literals;
|
||||
constexpr Speed auto v1 = avg_speed(220_q_km, 2_q_h);
|
||||
constexpr Speed auto v2 = avg_speed(140_q_mi, 2_q_h);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ The easiest way to print a quantity is to provide its object to the output
|
||||
stream::
|
||||
|
||||
using namespace units::physical::si::literals;
|
||||
using namespace units::physical::international::literals;
|
||||
using namespace units::physical::si::international::literals;
|
||||
constexpr Speed auto v1 = avg_speed(220._q_km, 2_q_h);
|
||||
constexpr Speed auto v2 = avg_speed(140._q_mi, 2_q_h);
|
||||
std::cout << v1 << '\n'; // 110 km/h
|
||||
|
||||
@@ -70,16 +70,16 @@ it really easy to define other systems of units. For example length in the
|
||||
`CGS <https://en.wikipedia.org/wiki/Centimetre%E2%80%93gram%E2%80%93second_system_of_units>`_
|
||||
could be defined as::
|
||||
|
||||
namespace cgs {
|
||||
namespace si::cgs {
|
||||
|
||||
struct dim_length : base_dimension<"L", si::centimetre> {};
|
||||
|
||||
}
|
||||
|
||||
The fact that both base dimensions use the same identifier ``"L"`` tells
|
||||
the library that bot definitions refer to the same physical dimension of
|
||||
the library that both definitions refer to the same physical dimension of
|
||||
length. The only difference is the measurement unit used to define their
|
||||
base dimensions. Thanks to using `si::centimetre` in the `cgs::dim_length`
|
||||
base dimensions. Thanks to using `si::centimetre` in the `si::cgs::dim_length`
|
||||
definition we also enabled the ability to easily convert between those
|
||||
2 base dimensions (as the library knows how to convert `si::metre` to
|
||||
`si::centimetre` and vice versa).
|
||||
@@ -308,7 +308,7 @@ In case the deduced unit should served as a named one we can use ether a
|
||||
by him/her-self or `noble_deduced_unit` where the symbol is the deduced name
|
||||
based on the ingredients::
|
||||
|
||||
namespace fps {
|
||||
namespace si::fps {
|
||||
|
||||
struct nautical_mile_per_hour : named_deduced_unit<nautical_mile_per_hour, dim_speed,
|
||||
"knot", no_prefix, nautical_mile, hour>{};
|
||||
|
||||
@@ -32,7 +32,7 @@ performed without sacrificing on accuracy. Please see the below example for a qu
|
||||
of basic library features::
|
||||
|
||||
#include <units/physical/si/speed.h>
|
||||
#include <units/physical/international/speed.h>
|
||||
#include <units/physical/si/international/speed.h>
|
||||
#include <units/format.h>
|
||||
#include <iostream>
|
||||
|
||||
@@ -47,7 +47,7 @@ of basic library features::
|
||||
{
|
||||
using namespace units::physical::si::literals;
|
||||
Speed auto v1 = avg_speed(220_q_km, 2_q_h);
|
||||
Speed auto v2 = avg_speed(si::length<international::mile>(140), si::time<si::hour>(2));
|
||||
Speed auto v2 = avg_speed(si::length<si::international::mile>(140), si::time<si::hour>(2));
|
||||
Speed auto v3 = quantity_cast<si::metre_per_second>(v2);
|
||||
Speed auto v4 = quantity_cast<int>(v3);
|
||||
|
||||
|
||||
Reference in new issue
Block a user