UnitManipulators(3)

UnitManipulators(3) Unit Conversion and Dimensional Analysis Library UnitManipulators(3)

NAME

UnitManipulators - Unit Manipulators


- Defines a series of classes used to manipulate unit types, such as inverse<>, squared<>, and metric prefixes.

SYNOPSIS

Typedefs


template<class U > using units::inverse = typename units::detail::inverse_impl< U >::type
represents the inverse unit type of class U. template<class U > using units::squared = typename units::detail::squared_impl< U >::type
represents the unit type of class U squared template<class U > using units::cubed = typename units::detail::cubed_impl< U >::type
represents the type of class U cubed. template<class U , std::intmax_t Eps = 10000000000> using units::square_root = typename units::detail::sqrt_impl< U, Eps >::type
represents the square root of type class U.

template<class U > using units::atto = typename units::detail::prefix< std::atto, U >::type
Represents the type of class U with the metric 'atto' prefix appended. template<class U > using units::femto = typename units::detail::prefix< std::femto, U >::type
Represents the type of class U with the metric 'femto' prefix appended. template<class U > using units::pico = typename units::detail::prefix< std::pico, U >::type
Represents the type of class U with the metric 'pico' prefix appended. template<class U > using units::nano = typename units::detail::prefix< std::nano, U >::type
Represents the type of class U with the metric 'nano' prefix appended. template<class U > using units::micro = typename units::detail::prefix< std::micro, U >::type
Represents the type of class U with the metric 'micro' prefix appended. template<class U > using units::milli = typename units::detail::prefix< std::milli, U >::type
Represents the type of class U with the metric 'milli' prefix appended. template<class U > using units::centi = typename units::detail::prefix< std::centi, U >::type
Represents the type of class U with the metric 'centi' prefix appended. template<class U > using units::deci = typename units::detail::prefix< std::deci, U >::type
Represents the type of class U with the metric 'deci' prefix appended. template<class U > using units::deca = typename units::detail::prefix< std::deca, U >::type
Represents the type of class U with the metric 'deca' prefix appended. template<class U > using units::hecto = typename units::detail::prefix< std::hecto, U >::type
Represents the type of class U with the metric 'hecto' prefix appended. template<class U > using units::kilo = typename units::detail::prefix< std::kilo, U >::type
Represents the type of class U with the metric 'kilo' prefix appended. template<class U > using units::mega = typename units::detail::prefix< std::mega, U >::type
Represents the type of class U with the metric 'mega' prefix appended. template<class U > using units::giga = typename units::detail::prefix< std::giga, U >::type
Represents the type of class U with the metric 'giga' prefix appended. template<class U > using units::tera = typename units::detail::prefix< std::tera, U >::type
Represents the type of class U with the metric 'tera' prefix appended. template<class U > using units::peta = typename units::detail::prefix< std::peta, U >::type
Represents the type of class U with the metric 'peta' prefix appended. template<class U > using units::exa = typename units::detail::prefix< std::exa, U >::type
Represents the type of class U with the metric 'exa' prefix appended.

template<class U > using units::kibi = typename units::detail::prefix< std::ratio< 1024 >, U >::type
Represents the type of class U with the binary 'kibi' prefix appended. template<class U > using units::mebi = typename units::detail::prefix< std::ratio< 1048576 >, U >::type
Represents the type of class U with the binary 'mibi' prefix appended. template<class U > using units::gibi = typename units::detail::prefix< std::ratio< 1073741824 >, U >::type
Represents the type of class U with the binary 'gibi' prefix appended. template<class U > using units::tebi = typename units::detail::prefix< std::ratio< 1099511627776 >, U >::type
Represents the type of class U with the binary 'tebi' prefix appended. template<class U > using units::pebi = typename units::detail::prefix< std::ratio< 1125899906842624 >, U >::type
Represents the type of class U with the binary 'pebi' prefix appended. template<class U > using units::exbi = typename units::detail::prefix< std::ratio< 1152921504606846976 >, U >::type
Represents the type of class U with the binary 'exbi' prefix appended.

Detailed Description

Defines a series of classes used to manipulate unit types, such as inverse<>, squared<>, and metric prefixes.

Unit manipulators can be chained together, e.g. inverse<squared<pico<time::seconds>>> to represent picoseconds^-2.

Typedef Documentation

template<class U > using units::atto = typedef typename units::detail::prefix<std::atto, U>::type

Represents the type of class U with the metric 'atto' prefix appended. E.g. atto<meters> represents meters*10^-18

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::centi = typedef typename units::detail::prefix<std::centi,U>::type

Represents the type of class U with the metric 'centi' prefix appended. E.g. centi<meters> represents meters*10^-2

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::cubed = typedef typename units::detail::cubed_impl<U>::type

represents the type of class U cubed.

Template Parameters

U unit type to cube.

E.g. cubed<meters> will represent meters^3.

template<class U > using units::deca = typedef typename units::detail::prefix<std::deca, U>::type

Represents the type of class U with the metric 'deca' prefix appended. E.g. deca<meters> represents meters*10^1

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::deci = typedef typename units::detail::prefix<std::deci, U>::type

Represents the type of class U with the metric 'deci' prefix appended. E.g. deci<meters> represents meters*10^-1

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::exa = typedef typename units::detail::prefix<std::exa, U>::type

Represents the type of class U with the metric 'exa' prefix appended. E.g. exa<meters> represents meters*10^18

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::exbi = typedef typename units::detail::prefix<std::ratio<1152921504606846976>, U>::type

Represents the type of class U with the binary 'exbi' prefix appended. E.g. exbi<bytes> represents bytes*2^60

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::femto = typedef typename units::detail::prefix<std::femto,U>::type

Represents the type of class U with the metric 'femto' prefix appended. E.g. femto<meters> represents meters*10^-15

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::gibi = typedef typename units::detail::prefix<std::ratio<1073741824>, U>::type

Represents the type of class U with the binary 'gibi' prefix appended. E.g. gibi<bytes> represents bytes*2^30

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::giga = typedef typename units::detail::prefix<std::giga, U>::type

Represents the type of class U with the metric 'giga' prefix appended. E.g. giga<meters> represents meters*10^9

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::hecto = typedef typename units::detail::prefix<std::hecto,U>::type

Represents the type of class U with the metric 'hecto' prefix appended. E.g. hecto<meters> represents meters*10^2

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::inverse = typedef typename units::detail::inverse_impl<U>::type

represents the inverse unit type of class U.

Template Parameters

U unit type to invert.

E.g. inverse<meters> will represent meters^-1 (i.e. 1/meters).

template<class U > using units::kibi = typedef typename units::detail::prefix<std::ratio<1024>, U>::type

Represents the type of class U with the binary 'kibi' prefix appended. E.g. kibi<bytes> represents bytes*2^10

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::kilo = typedef typename units::detail::prefix<std::kilo, U>::type

Represents the type of class U with the metric 'kilo' prefix appended. E.g. kilo<meters> represents meters*10^3

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::mebi = typedef typename units::detail::prefix<std::ratio<1048576>, U>::type

Represents the type of class U with the binary 'mibi' prefix appended. E.g. mebi<bytes> represents bytes*2^20

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::mega = typedef typename units::detail::prefix<std::mega, U>::type

Represents the type of class U with the metric 'mega' prefix appended. E.g. mega<meters> represents meters*10^6

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::micro = typedef typename units::detail::prefix<std::micro,U>::type

Represents the type of class U with the metric 'micro' prefix appended. E.g. micro<meters> represents meters*10^-6

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::milli = typedef typename units::detail::prefix<std::milli,U>::type

Represents the type of class U with the metric 'milli' prefix appended. E.g. milli<meters> represents meters*10^-3

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::nano = typedef typename units::detail::prefix<std::nano, U>::type

Represents the type of class U with the metric 'nano' prefix appended. E.g. nano<meters> represents meters*10^-9

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::pebi = typedef typename units::detail::prefix<std::ratio<1125899906842624>, U>::type

Represents the type of class U with the binary 'pebi' prefix appended. E.g. pebi<bytes> represents bytes*2^50

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::peta = typedef typename units::detail::prefix<std::peta, U>::type

Represents the type of class U with the metric 'peta' prefix appended. E.g. peta<meters> represents meters*10^15

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::pico = typedef typename units::detail::prefix<std::pico, U>::type

Represents the type of class U with the metric 'pico' prefix appended. E.g. pico<meters> represents meters*10^-12

Template Parameters

U unit type to apply the prefix to.

template<class U , std::intmax_t Eps = 10000000000> using units::square_root = typedef typename units::detail::sqrt_impl<U, Eps>::type

represents the square root of type class U. Calculates a rational approximation of the square root of the unit. The error in the calculation is bounded by 1/epsilon (Eps). E.g. for the default value of 10000000000, the maximum error will be a/10000000000, or 1e-8, or said another way, the error will be on the order of 10^-9. Since these calculations are done at compile time, it is advisable to set epsilon to the highest value that does not cause an integer overflow in the calculation. If you can't compile ratio_sqrt due to overflow errors, reducing the value of epsilon sufficiently will correct the problem.


ratio_sqrt is guaranteed to converge for all values of Ratio which do not overflow.

Template Parameters

U unit type to take the square root of.
Eps Value of epsilon, which represents the inverse of the maximum allowable error. This value should be chosen to be as high as possible before integer overflow errors occur in the compiler.

Note

USE WITH CAUTION. The is an approximate value. In general, squared<sqrt<meter>> != meter, i.e. the operation is not reversible, and it will result in propogated approximations. Use only when absolutely necessary.

template<class U > using units::squared = typedef typename units::detail::squared_impl<U>::type

represents the unit type of class U squared

Template Parameters

U unit type to square.

E.g. square<meters> will represent meters^2.

template<class U > using units::tebi = typedef typename units::detail::prefix<std::ratio<1099511627776>, U>::type

Represents the type of class U with the binary 'tebi' prefix appended. E.g. tebi<bytes> represents bytes*2^40

Template Parameters

U unit type to apply the prefix to.

template<class U > using units::tera = typedef typename units::detail::prefix<std::tera, U>::type

Represents the type of class U with the metric 'tera' prefix appended. E.g. tera<meters> represents meters*10^12

Template Parameters

U unit type to apply the prefix to.

Author

Generated automatically by Doxygen for Unit Conversion and Dimensional Analysis Library from the source code.

Wed Mar 29 2023 Version 2.3.0