wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
Unit.hpp
Go to the documentation of this file.
1#pragma once
2
5#include "wuzp/core/Unit.hpp"
7
8namespace wuzp_units {
9
11template <typename TimeT_, typename LengthT_, typename MassT_, typename ElectricCurrentT_, typename ThermodynamicTemperatureT_,
12 typename AmountOfSubstanceT_, typename LuminousIntensityT_>
13struct UnitImpl;
14
15template <int TimeV_, int LengthV_, int MassV_, int ElectricCurrentV_, int ThermodynamicTemperatureV_, int AmountOfSubstanceV_,
16 int LuminousIntensityV_>
20
21using Acceleration = wuzp::Unit<CreateIntegerUnitImpl<-2, 1, 0, 0, 0, 0, 0>>;
24using AngularVelocity = wuzp::Unit<CreateIntegerUnitImpl<-1, 0, 0, 0, 0, 0, 0>>;
27using Energy = wuzp::Unit<CreateIntegerUnitImpl<-2, 2, 1, 0, 0, 0, 0>>;
28using Force = wuzp::Unit<CreateIntegerUnitImpl<-2, 1, 1, 0, 0, 0, 0>>;
29using Torque = wuzp::Unit<CreateIntegerUnitImpl<-2, 2, 1, 0, 0, 0, 0>>;
30using Frequency = wuzp::Unit<CreateIntegerUnitImpl<-1, 0, 0, 0, 0, 0, 0>>;
34using Velocity = wuzp::Unit<CreateIntegerUnitImpl<-1, 1, 0, 0, 0, 0, 0>>;
36
37} // namespace wuzp_units
38
39namespace wuzp {
40
41template <typename... ExponentsLhsT_, typename... ExponentsRhsT_>
42struct Product<Unit<wuzp_units::UnitImpl<ExponentsLhsT_...>>, Unit<wuzp_units::UnitImpl<ExponentsRhsT_...>>> {
44};
45
46template <typename... ExponentsLhsT_, typename... ExponentsRhsT_>
47struct Division<Unit<wuzp_units::UnitImpl<ExponentsLhsT_...>>, Unit<wuzp_units::UnitImpl<ExponentsRhsT_...>>> {
49};
50
51template <typename... ExponentsT_, typename ExponentT_>
52struct Power<Unit<wuzp_units::UnitImpl<ExponentsT_...>>, ExponentT_> {
54};
55
56template <typename... ExponentsT_>
60
61template <typename... ExponentsT_>
65
66template <typename ValueT_>
84
85} // namespace wuzp
wuzp::Unit< CreateIntegerUnitImpl<-2, 2, 1, 0, 0, 0, 0 > > Torque
Definition Unit.hpp:29
wuzp::Unit< CreateIntegerUnitImpl<-1, 1, 0, 0, 0, 0, 0 > > Velocity
Definition Unit.hpp:34
wuzp::Unit< CreateIntegerUnitImpl< 0, 0, 0, 0, 0, 0, 0 > > Dimensionless
Definition Unit.hpp:26
wuzp::Unit< CreateIntegerUnitImpl< 0, 1, 0, 0, 0, 0, 0 > > Length
Definition Unit.hpp:31
wuzp::Unit< CreateIntegerUnitImpl< 0, 3, 0, 0, 0, 0, 0 > > Volume
Definition Unit.hpp:35
wuzp::Unit< CreateIntegerUnitImpl<-1, 0, 0, 0, 0, 0, 0 > > AngularVelocity
Definition Unit.hpp:24
wuzp::Unit< CreateIntegerUnitImpl<-2, 1, 1, 0, 0, 0, 0 > > Force
Definition Unit.hpp:28
wuzp::Unit< CreateIntegerUnitImpl<-2, 2, 1, 0, 0, 0, 0 > > Energy
Definition Unit.hpp:27
wuzp::Unit< CreateIntegerUnitImpl<-2, 0, 0, 0, 0, 0, 0 > > AngularAcceleration
Definition Unit.hpp:23
wuzp::Unit< CreateIntegerUnitImpl< 0, 2, 0, 0, 0, 0, 0 > > Area
Definition Unit.hpp:25
wuzp::Unit< CreateIntegerUnitImpl< 0, 0, 0, 0, 0, 0, 0 > > Angle
Definition Unit.hpp:22
wuzp::Unit< CreateIntegerUnitImpl< 1, 0, 0, 0, 0, 0, 0 > > Time
Definition Unit.hpp:33
wuzp::Unit< CreateIntegerUnitImpl<-2, 1, 0, 0, 0, 0, 0 > > Acceleration
Definition Unit.hpp:21
wuzp::Unit< CreateIntegerUnitImpl< 0, 0, 1, 0, 0, 0, 0 > > Mass
Definition Unit.hpp:32
UnitImpl< wuzp::Integer< TimeV_ >, wuzp::Integer< LengthV_ >, wuzp::Integer< MassV_ >, wuzp::Integer< ElectricCurrentV_ >, wuzp::Integer< ThermodynamicTemperatureV_ >, wuzp::Integer< AmountOfSubstanceV_ >, wuzp::Integer< LuminousIntensityV_ > > CreateIntegerUnitImpl
Definition Unit.hpp:17
wuzp::Unit< CreateIntegerUnitImpl<-1, 0, 0, 0, 0, 0, 0 > > Frequency
Definition Unit.hpp:30
Rational< ValueV_, 1 > Integer
Definition Integer.hpp:9
Type wrapper which is used to access traits partially specialized in the implementation header files.
Definition helpers.hpp:114
wuzp_units::AngularAcceleration AngularAcceleration
Definition Unit.hpp:70
wuzp_units::AngularVelocity AngularVelocity
Definition Unit.hpp:71
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Definition traits.hpp:338
Unit< wuzp_units::UnitImpl< typename Difference< ExponentsLhsT_, ExponentsRhsT_ >::type... > > type
Definition Unit.hpp:48
Unit< wuzp_units::CreateIntegerUnitImpl< 0, 0, 0, 0, 0, 0, 0 > > type
Definition Unit.hpp:58
Unit< wuzp_units::UnitImpl< typename Negation< ExponentsT_ >::type... > > type
Definition Unit.hpp:63
The inverse: the matrix inverse of a matrix, like Eigen's MatrixBase::inverse(), and the reciprocal o...
Definition traits.hpp:188
Unit< wuzp_units::UnitImpl< typename Product< ExponentT_, ExponentsT_ >::type... > > type
Definition Unit.hpp:53
Unit< wuzp_units::UnitImpl< typename Sum< ExponentsLhsT_, ExponentsRhsT_ >::type... > > type
Definition Unit.hpp:43
A unit, given by the rational exponents of the seven SI base units.
Definition Unit.hpp:13