units
Use physical dimensions at compile-time or run-time.
|
Template used to construct a number of kilonewtons. More...
#include <units.hpp>
Public Member Functions | |
constexpr | kilonewtons (T v) |
Initialize from number of kilonewtons. More... | |
![]() | |
basic_statdim () | |
By default, initialize dimension, but leave number uninitialized. More... | |
constexpr | basic_statdim (stat< OT > dv) |
Initialize from compatible statdim. More... | |
constexpr | basic_statdim (dimval< OT, dyndim_base > const &v) |
Initialize from dyndim. More... | |
![]() | |
dimval () | |
< Allow access to dimension. More... | |
constexpr | dimval (T const &v, dim const &d) |
Initialize from numeric value and from dimension. More... | |
constexpr | dimval (dimval< OT, OB > const &v) |
Initialize from other dimensioned value. More... | |
constexpr | dimval (T const &n) |
Initialize from dimensionless number. More... | |
constexpr T | to_number () const |
Convert to dimensionless number. More... | |
constexpr dim::rat | d (dim::off off) const |
Exponent for base at specified offset. More... | |
constexpr auto | operator== (dimval< OT, OB > const &v) const |
Equality-comparison of two dimensioned values. More... | |
constexpr auto | operator!= (dimval< OT, OB > const &v) const |
Inequality-comparison of two dimensioned values. More... | |
constexpr auto | operator< (dimval< OT, OB > const &v) const |
Less-than comparison of two dimensioned values. More... | |
constexpr auto | operator<= (dimval< OT, OB > const &v) const |
Less-than-or-equal comparison of two dimensioned values. More... | |
constexpr auto | operator> (dimval< OT, OB > const &v) const |
Greater-than comparison of two dimensioned values. More... | |
constexpr auto | operator>= (dimval< OT, OB > const &v) const |
Greater-than-or-equal comparison of two dimensioned values. More... | |
constexpr auto | operator+ (dimval< OT, OB > const &v) const |
Sum of two dimensioned values. More... | |
constexpr auto | operator- (dimval< OT, OB > const &v) const |
Difference between two dimensioned values. More... | |
constexpr dimval & | operator+= (dimval< OT, OB > const &v) |
Modify present instance by adding in a dimensioned value. More... | |
constexpr dimval & | operator-= (dimval< OT, OB > const &v) |
Modify present instance by subtracting out a dimensioned value. More... | |
constexpr auto | operator* (OT const &n) const |
Scale dimensioned value. More... | |
constexpr auto | operator* (dimval< OT, OB > const &v) const |
Multiply two dimensioned values. More... | |
constexpr auto | operator[] (size_t off) const |
Support element-access in case it be supported by numeric type. More... | |
constexpr auto | dot (OT const &n) const |
Support dot-product in case it be supported by numeric type. More... | |
constexpr auto | dot (dimval< OT, OB > const &v) const |
Support dot-product in case it be supported by numeric type. More... | |
constexpr auto | cross (OT const &n) const |
Support cross-product in case it be supported by numeric type. More... | |
constexpr auto | cross (dimval< OT, OB > const &v) const |
Support cross-product in case it be supported by numeric type. More... | |
constexpr auto | operator/ (OT const &n) const |
Scale dimensioned quantity by dividing by number. More... | |
constexpr auto | operator/ (dimval< OT, OB > const &v) const |
Divide two dimensioned values. More... | |
constexpr dimval< T, typename statdim_base< D >::recip_basedim > | inverse () const |
Invert dimensioned value. More... | |
constexpr dimval & | operator*= (OT const &v) |
Modify present instance by multiplying in a dimensionless value. More... | |
constexpr dimval & | operator/= (OT const &v) |
Modify present instance by dividing it by a dimensionless value. More... | |
constexpr auto | power () const |
Raise dimensioned value to rational power. More... | |
constexpr auto | power (dim::rat p) const |
Raise dimensioned value to rational power. More... | |
constexpr auto | square_root () const |
Square-root of a dimensioned quantity. More... | |
![]() | |
constexpr | statdim_base (dim dd) |
Check for compatibility on contruction from dim. More... | |
constexpr | statdim_base () |
Allow default construction. More... | |
Static Public Attributes | |
static constexpr long double const | sf = 1000.0 |
Scale factor. More... | |
![]() | |
static constexpr auto | recip_dim = nul_dim - d() |
Dimensions corresponding to reciprocal of dimensioned quantity. More... | |
Additional Inherited Members | |
![]() | |
using | recip_basedim = statdim_base< recip_dim.encode()> |
Base-dimension-type corresponding to reciprocal of dimensioned quantity. More... | |
![]() | |
static constexpr dim | d () |
Exponent for each unit in dimensioned quantity. More... | |
static constexpr void | number () |
Throw if dimension be non-null. More... | |
static constexpr void | comparison (statdim_base) |
Test for comparison of dimensioned values. More... | |
static constexpr void | comparison (dyndim_base const &db) |
Test for comparison of dimensioned values. More... | |
static constexpr auto | sum (statdim_base) |
Dimension for sum of dimensioned values. More... | |
static constexpr dyndim_base | sum (dyndim_base const &db) |
Dimension for sum of dimensioned values. More... | |
static constexpr auto | diff (statdim_base) |
Dimension for difference of dimensioned values. More... | |
static constexpr dyndim_base | diff (dyndim_base const &db) |
Dimension for difference of dimensioned values. More... | |
template<dim::word OD> | |
static constexpr auto | prod (statdim_base< OD >) |
Dimension for product of dimensioned values. More... | |
static constexpr dyndim_base | prod (dyndim_base const &db) |
Dimension for product of dimensioned values. More... | |
template<dim::word OD> | |
static constexpr auto | quot (statdim_base< OD >) |
Dimension for quotient of dimensioned values. More... | |
static constexpr dyndim_base | quot (dyndim_base const &db) |
Dimension for quotient of dimensioned values. More... | |
static constexpr recip_basedim | recip () |
Dimension for reciprocal of dimensioned value. More... | |
template<int64_t PN, int64_t PD = 1> | |
static constexpr auto | pow () |
Dimension for rational power of dimensioned value. More... | |
static constexpr dyndim_base | pow (dim::rat p) |
Dimension for rational power of dimensioned value. More... | |
static constexpr auto | sqrt () |
Dimension for square-root of dimensioned value. More... | |
![]() | |
using | recip_basedim = statdim_base< recip_dim.encode()> |
Base-dimension-type corresponding to reciprocal of dimensioned quantity. More... | |
![]() | |
dimval (dim const &d) | |
Initialize dimension, but leave number undefined. More... | |
![]() | |
constexpr | statdim_base (dim dd) |
Check for compatibility on contruction from dim. More... | |
constexpr | statdim_base () |
Allow default construction. More... | |
![]() | |
static constexpr dim | d () |
Exponent for each unit in dimensioned quantity. More... | |
static constexpr void | number () |
Throw if dimension be non-null. More... | |
static constexpr void | comparison (statdim_base) |
Test for comparison of dimensioned values. More... | |
static constexpr void | comparison (dyndim_base const &db) |
Test for comparison of dimensioned values. More... | |
static constexpr auto | sum (statdim_base) |
Dimension for sum of dimensioned values. More... | |
static constexpr dyndim_base | sum (dyndim_base const &db) |
Dimension for sum of dimensioned values. More... | |
static constexpr auto | diff (statdim_base) |
Dimension for difference of dimensioned values. More... | |
static constexpr dyndim_base | diff (dyndim_base const &db) |
Dimension for difference of dimensioned values. More... | |
template<dim::word OD> | |
static constexpr auto | prod (statdim_base< OD >) |
Dimension for product of dimensioned values. More... | |
static constexpr dyndim_base | prod (dyndim_base const &db) |
Dimension for product of dimensioned values. More... | |
template<dim::word OD> | |
static constexpr auto | quot (statdim_base< OD >) |
Dimension for quotient of dimensioned values. More... | |
static constexpr dyndim_base | quot (dyndim_base const &db) |
Dimension for quotient of dimensioned values. More... | |
static constexpr recip_basedim | recip () |
Dimension for reciprocal of dimensioned value. More... | |
template<int64_t PN, int64_t PD = 1> | |
static constexpr auto | pow () |
Dimension for rational power of dimensioned value. More... | |
static constexpr dyndim_base | pow (dim::rat p) |
Dimension for rational power of dimensioned value. More... | |
static constexpr auto | sqrt () |
Dimension for square-root of dimensioned value. More... | |
![]() | |
static constexpr auto | recip_dim = nul_dim - d() |
Dimensions corresponding to reciprocal of dimensioned quantity. More... | |
Template used to construct a number of kilonewtons.
T | Numeric type (float, double, etc.). |
|
inline |
Initialize from number of kilonewtons.
Definition at line 900 of file units.hpp.
|
static |