units
Use physical dimensions at compile-time or run-time.
Public Member Functions | Static Public Attributes | List of all members
vnix::units::impl::kilojoules< T > Struct Template Reference

Template used to construct a number of kilojoules. More...

#include <units.hpp>

Inheritance diagram for vnix::units::impl::kilojoules< T >:
[legend]
Collaboration diagram for vnix::units::impl::kilojoules< T >:
[legend]

Public Member Functions

constexpr kilojoules (T v)
 Initialize from number of kilojoules. More...
 
- Public Member Functions inherited from vnix::units::basic_statdim<(N< float >.d()+m< float >.d()).encode(), T >
 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...
 
- Public Member Functions inherited from vnix::units::dimval< T, statdim_base< D > >
 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 dimvaloperator+= (dimval< OT, OB > const &v)
 Modify present instance by adding in a dimensioned value. More...
 
constexpr dimvaloperator-= (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_basediminverse () const
 Invert dimensioned value. More...
 
constexpr dimvaloperator*= (OT const &v)
 Modify present instance by multiplying in a dimensionless value. More...
 
constexpr dimvaloperator/= (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...
 
- Public Member Functions inherited from vnix::units::statdim_base< D >
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 Public Attributes inherited from vnix::units::statdim_base< D >
static constexpr auto recip_dim = nul_dim - d()
 Dimensions corresponding to reciprocal of dimensioned quantity. More...
 

Additional Inherited Members

- Public Types inherited from vnix::units::statdim_base< D >
using recip_basedim = statdim_base< recip_dim.encode()>
 Base-dimension-type corresponding to reciprocal of dimensioned quantity. More...
 
- Static Public Member Functions inherited from vnix::units::statdim_base< D >
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...
 
- Protected Types inherited from vnix::units::statdim_base< D >
using recip_basedim = statdim_base< recip_dim.encode()>
 Base-dimension-type corresponding to reciprocal of dimensioned quantity. More...
 
- Protected Member Functions inherited from vnix::units::dimval< T, statdim_base< D > >
 dimval (dim const &d)
 Initialize dimension, but leave number undefined. More...
 
- Protected Member Functions inherited from vnix::units::statdim_base< D >
constexpr statdim_base (dim dd)
 Check for compatibility on contruction from dim. More...
 
constexpr statdim_base ()
 Allow default construction. More...
 
- Static Protected Member Functions inherited from vnix::units::statdim_base< D >
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 Protected Attributes inherited from vnix::units::statdim_base< D >
static constexpr auto recip_dim = nul_dim - d()
 Dimensions corresponding to reciprocal of dimensioned quantity. More...
 

Detailed Description

template<typename T>
struct vnix::units::impl::kilojoules< T >

Template used to construct a number of kilojoules.

Template Parameters
TNumeric type (float, double, etc.).

Definition at line 1027 of file units.hpp.

Constructor & Destructor Documentation

template<typename T >
constexpr vnix::units::impl::kilojoules< T >::kilojoules ( v)
inline

Initialize from number of kilojoules.

Definition at line 1032 of file units.hpp.

1032  :
1033  basic_statdim<(N<float>.d()+m<float>.d()).encode(), T>(
1034  sf * joules<T>::sf * v,
1035  N<float>.d()+m<float>.d())
1036  {}
static constexpr long double const sf
Scale factor.
Definition: units.hpp:1029
static constexpr long double const sf
Scale factor.
Definition: units.hpp:963

Here is the call graph for this function:

Member Data Documentation

template<typename T >
constexpr long double const vnix::units::impl::kilojoules< T >::sf = 1000.0
static

Scale factor.

Definition at line 1029 of file units.hpp.


The documentation for this struct was generated from the following file: