16 #ifndef LARDATAALG_UTILITIES_QUANTITIES_SPACETIME_H
17 #define LARDATAALG_UTILITIES_QUANTITIES_SPACETIME_H
24 #include <string_view>
29 namespace util::quantities {
33 using namespace std::string_view_literals;
36 static constexpr
auto symbol =
"s"sv;
37 static constexpr
auto name =
"second"sv;
41 static constexpr
auto symbol =
"m"sv;
42 static constexpr
auto name =
"meter"sv;
70 template <
typename R,
typename T =
double>
77 template <
typename T =
double>
81 template <
typename T =
double>
94 template <
typename T =
double>
98 template <
typename T =
double>
111 template <
typename T =
double>
115 template <
typename T =
double>
128 template <
typename T =
double>
132 template <
typename T =
double>
145 template <
typename T =
double>
149 template <
typename T =
double>
175 namespace time_literals {
179 constexpr
second operator""_s (
long double v)
180 {
return second{
static_cast<double>(v) }; }
181 constexpr
second operator""_s (
unsigned long long int v)
182 {
return second{
static_cast<double>(v) }; }
204 {
return nanosecond{
static_cast<double>(v) }; }
205 constexpr
nanosecond operator""_ns (
unsigned long long int v)
206 {
return nanosecond{
static_cast<double>(v) }; }
212 {
return picosecond{
static_cast<double>(v) }; }
213 constexpr
picosecond operator""_ps (
unsigned long long int v)
214 {
return picosecond{
static_cast<double>(v) }; }
222 namespace intervals {
225 template <
typename R,
typename T =
double>
233 template <
typename T =
double>
244 template <
typename T =
double>
255 template <
typename T =
double>
266 template <
typename T =
double>
277 template <
typename T =
double>
294 template <
typename R,
typename T =
double,
typename Cat = NoCategory>
302 template <
typename T =
double,
typename Cat = NoCategory>
313 template <
typename T =
double,
typename Cat = NoCategory>
324 template <
typename T =
double,
typename Cat = NoCategory>
335 template <
typename T =
double,
typename Cat = NoCategory>
346 template <
typename T =
double,
typename Cat = NoCategory>
385 template <
typename R,
typename T =
double>
392 template <
typename T =
double>
396 template <
typename T =
double>
409 template <
typename T =
double>
413 template <
typename T =
double>
426 template <
typename T =
double>
430 template <
typename T =
double>
443 template <
typename T =
double>
447 template <
typename T =
double>
460 template <
typename T =
double>
464 template <
typename T =
double>
477 template <
typename T =
double>
481 template <
typename T =
double>
494 template <
typename T =
double>
498 template <
typename T =
double>
511 template <
typename T =
double>
515 template <
typename T =
double>
543 namespace space_literals {
547 constexpr
meter operator""_m (
long double v)
548 {
return meter{
static_cast<double>(v) }; }
549 constexpr
meter operator""_m (
unsigned long long int v)
550 {
return meter{
static_cast<double>(v) }; }
556 {
return kilometer{
static_cast<double>(v) }; }
557 constexpr
kilometer operator""_km (
unsigned long long int v)
558 {
return kilometer{
static_cast<double>(v) }; }
564 {
return centimeter{
static_cast<double>(v) }; }
565 constexpr
centimeter operator""_cm (
unsigned long long int v)
566 {
return centimeter{
static_cast<double>(v) }; }
572 {
return millimeter{
static_cast<double>(v) }; }
573 constexpr
millimeter operator""_mm (
unsigned long long int v)
574 {
return millimeter{
static_cast<double>(v) }; }
580 {
return micrometer{
static_cast<double>(v) }; }
581 constexpr
micrometer operator""_um (
unsigned long long int v)
582 {
return micrometer{
static_cast<double>(v) }; }
588 {
return nanometer{
static_cast<double>(v) }; }
589 constexpr
nanometer operator""_nm (
unsigned long long int v)
590 {
return nanometer{
static_cast<double>(v) }; }
596 {
return picometer{
static_cast<double>(v) }; }
597 constexpr
picometer operator""_pm (
unsigned long long int v)
598 {
return picometer{
static_cast<double>(v) }; }
604 {
return femtometer{
static_cast<double>(v) }; }
605 constexpr
femtometer operator""_fm (
unsigned long long int v)
606 {
return femtometer{
static_cast<double>(v) }; }
614 namespace intervals {
617 template <
typename R,
typename T =
double>
625 template <
typename T =
double>
636 template <
typename T =
double>
647 template <
typename T =
double>
658 template <
typename T =
double>
669 template <
typename T =
double>
680 template <
typename T =
double>
691 template <
typename T =
double>
702 template <
typename T =
double>
719 template <
typename R,
typename T =
double,
typename Cat = NoCategory>
727 template <
typename T =
double,
typename Cat = NoCategory>
738 template <
typename T =
double,
typename Cat = NoCategory>
749 template <
typename T =
double,
typename Cat = NoCategory>
760 template <
typename T =
double,
typename Cat = NoCategory>
771 template <
typename T =
double,
typename Cat = NoCategory>
782 template <
typename T =
double,
typename Cat = NoCategory>
793 template <
typename T =
double,
typename Cat = NoCategory>
804 template <
typename T =
double,
typename Cat = NoCategory>
826 #endif // LARDATAALG_UTILITIES_QUANTITIES_SPACETIME_H
picosecond_as<> picosecond
Type of time stored in picoseconds, in double precision.
microsecond_as<> microsecond
Type of time stored in microseconds, in double precision.
millimeter_as<> millimeter
Type of space stored in millimeters, in double precision.
kilometer_as<> kilometer
Type of space stored in kilometers, in double precision.
millisecond_as<> millisecond
Type of time stored in milliseconds, in double precision.
femtometer_as<> femtometer
Type of space stored in femtometers, in double precision.
concepts::Interval< util::quantities::scaled_meter< R, T >> scaled_meters
The most generic units::Meter-based interval.
Defines point and interval variables based on quantities.
A value measured in the specified unit.
concepts::Interval< util::quantities::scaled_second< R, T >> scaled_seconds
The most generic units::Second-based interval.
An interval (duration, length, distance) between two quantity points.
meter_as<> meter
Type of space stored in meters, in double precision.
Numeric variable proxies with embedded unit of measurement.
nanosecond_as<> nanosecond
Type of time stored in nanoseconds, in double precision.
picometer_as<> picometer
Type of space stored in picometers, in double precision.
micrometer_as<> micrometer
Type of space stored in micrometers, in double precision.
second_as<> second
Type of time stored in seconds, in double precision.
nanometer_as<> nanometer
Type of space stored in nanometers, in double precision.
centimeter_as<> centimeter
Type of space stored in centimeters, in double precision.