units
Use physical dimensions at compile-time or run-time.
|
Base-type for a dimensioned value whose dimension is specified, perhaps dynamically at run-time, by way of the constructor. More...
#include <dyndim-base.hpp>
Public Types | |
using | recip_basedim = dyndim_base |
Base-dimensions corresponding to reciprocal of dimensioned quantity. More... | |
Public Member Functions | |
constexpr | dyndim_base (dim dd) |
Initialize from exponents representing dimension. More... | |
constexpr dim | d () const |
Exponent for each unit in dimensioned quantity. More... | |
constexpr void | number () const |
Throw if dimension be non-null. More... | |
template<typename B > | |
constexpr void | comparison (B const &b) const |
Test for comparison of dimensioned values. More... | |
template<typename B > | |
constexpr dyndim_base | sum (B const &b) const |
Dimension for sum of dimensioned values. More... | |
template<typename B > | |
constexpr dyndim_base | diff (B const &b) const |
Dimension for difference of dimensioned values. More... | |
template<typename B > | |
constexpr dyndim_base | prod (B const &b) const |
Dimension for product of dimensioned values. More... | |
template<typename B > | |
constexpr dyndim_base | quot (B const &b) const |
Dimension for quotient of dimensioned values. More... | |
constexpr recip_basedim | recip () const |
Dimension for reciprocal of dimensioned value. More... | |
template<int64_t PN, int64_t PD = 1> | |
constexpr dyndim_base | pow () const |
Dimension for rational power of dimensioned value. More... | |
constexpr dyndim_base | pow (dim::rat p) const |
Dimension for rational power of dimensioned value. More... | |
constexpr dyndim_base | sqrt () const |
Dimension for square-root of dimensioned value. More... | |
Private Attributes | |
dim | d_ |
Exponents representing dimension. More... | |
Base-type for a dimensioned value whose dimension is specified, perhaps dynamically at run-time, by way of the constructor.
The dimension is specified as a set of exponents, one for each of the five base dimensions (time, length, mass, charge, and temperature).
For statdim_base, the dimension is always known statically at compile-time. For dyndim_base, the dimension is known statically at compile-time only if the dimension be specified to the constructor as a constant expression.
Definition at line 24 of file dyndim-base.hpp.
Base-dimensions corresponding to reciprocal of dimensioned quantity.
Definition at line 82 of file dyndim-base.hpp.
|
inline |
Initialize from exponents representing dimension.
Definition at line 29 of file dyndim-base.hpp.
|
inline |
Test for comparison of dimensioned values.
B | dyndim_base or statdim_base. |
b | Dimension of right side. |
Definition at line 43 of file dyndim-base.hpp.
|
inline |
Exponent for each unit in dimensioned quantity.
This is not static because it needs to be consistent with signature of dyndim.
Definition at line 33 of file dyndim-base.hpp.
|
inline |
Dimension for difference of dimensioned values.
B | dyndim_base or statdim_base. |
b | Dimension of subtractor. |
Definition at line 60 of file dyndim-base.hpp.
|
inline |
Throw if dimension be non-null.
Definition at line 36 of file dyndim-base.hpp.
|
inline |
Dimension for rational power of dimensioned value.
PN | Numerator of power. |
PD | Denominator of power. |
Definition at line 92 of file dyndim-base.hpp.
|
inline |
Dimension for rational power of dimensioned value.
p | Rational power. |
Definition at line 99 of file dyndim-base.hpp.
|
inline |
Dimension for product of dimensioned values.
B | dyndim_base or statdim_base. |
b | Dimension of factor. |
Definition at line 69 of file dyndim-base.hpp.
|
inline |
Dimension for quotient of dimensioned values.
B | dyndim_base or statdim_base. |
b | Dimension of divisor. |
Definition at line 77 of file dyndim-base.hpp.
|
inline |
Dimension for reciprocal of dimensioned value.
Definition at line 86 of file dyndim-base.hpp.
|
inline |
Dimension for square-root of dimensioned value.
Definition at line 103 of file dyndim-base.hpp.
|
inline |
Dimension for sum of dimensioned values.
B | dyndim_base or statdim_base. |
b | Dimension of addend. |
Definition at line 51 of file dyndim-base.hpp.
|
private |
Exponents representing dimension.
Definition at line 25 of file dyndim-base.hpp.