Project
Loading...
Searching...
No Matches
SI::detail Namespace Reference

Classes

struct  dimension
struct  quantity
struct  unit
struct  dimension_of
struct  dimension_of< dimension< Length, Mass, Time, Temperature, Current, Substance, Intensity > >
struct  dimension_of< quantity< Dimension, T > >
struct  dimension_of< unit< Dimension, Ratio > >
struct  zero_t
struct  scalar_value_type
struct  scalar_value_type< zero_t >
struct  scalar_value_type< quantity< Dimension, T > >
class  quantity_storage
struct  is_si
struct  is_si< quantity< Dimension, T > >
struct  is_si< zero_t >
struct  element_count
struct  element_count< quantity< Dimension, T > >
struct  ratio
struct  tag_celsius
struct  tag_fahrenheit
struct  ratio_product
struct  ratio_quotient
struct  is_arithmetic
struct  unit< Dimension, ratio< N, N > >
struct  unit< dimensionless, Ratio >
struct  unit< dimensionless, ratio< N, N > >

Typedefs

template<class T>
using vec2 = internal::vec2<T>
template<class T>
using vec3 = internal::vec3<T>
template<long Value>
using value_dimension = dimension<Value, Value, Value, Value, Value, Value, Value>
using dimensionless = value_dimension<0>
template<class T>
using dimension_of_t = typename dimension_of<std::decay_t<T>>::type
template<class Lhs, class Rhs>
using dimension_add_impl = SI_DIMENSION_OP(+)
template<class Lhs, class Rhs>
using dimension_subtract_impl = SI_DIMENSION_OP(-)
template<class Lhs, class Rhs>
using dimension_multiply_impl = SI_DIMENSION_OP(*)
template<class Lhs, class Rhs>
using dimension_divide_impl = SI_DIMENSION_OP(/)
template<class Lhs, class Rhs>
using dimension_add = dimension_add_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>
template<class Lhs, class Rhs>
using dimension_subtract = dimension_subtract_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>
template<class Lhs, class Rhs>
using dimension_multiply = dimension_multiply_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>
template<class Lhs, class Rhs>
using dimension_divide = dimension_divide_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>
template<class T>
using scalar_value_type_t = typename scalar_value_type<T>::type
template<class Lhs, class Rhs>
using dimension_common = std::conditional_t<std::is_same_v<Lhs, zero_t>, dimension_of_t<Rhs>, dimension_of_t<Lhs>>
template<class T, class U = void, class V = void>
using enable_for_si = std::enable_if_t<is_si_v<T> || is_si_v<U> || is_si_v<V>>
template<class T>
using promoted_scalar_type = std::conditional_t<std::is_same_v<scalar_value_type_t<T>, SIdouble>, SIdouble, SIdouble>

Functions

template<class T>
SI_INLINE_CONSTEXPR std::enable_if_t< std::is_arithmetic_v< T > > fill (T &x, T value)
template<class T, class = std::enable_if_t<!is_si_v<T>>>
SI_INLINE_CONSTEXPR const T & value (const T &x)
SI_INLINE_CONSTEXPR long value (zero_t)
template<class T, class U>
SI_INLINE_CONSTEXPR decltype(auto) value2 (T &&x, U)
template<class U>
SI_INLINE_CONSTEXPR auto value2 (zero_t, const U &other)
template<class T, class Dimension>
SI_INLINE_CONSTEXPR quantity< Dimension, T > operator- (quantity< Dimension, T > x)
template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & operator+= (quantity< Dimension, T > &lhs, const U &rhs)
template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & operator-= (quantity< Dimension, T > &lhs, const U &rhs)
template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & operator*= (quantity< Dimension, T > &lhs, const U &rhs)
template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & operator/= (quantity< Dimension, T > &lhs, const U &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator< (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator<= (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator> (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator>= (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator== (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator!= (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator+ (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator- (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator* (const Lhs &lhs, const Rhs &rhs)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto operator/ (const Lhs &lhs, const Rhs &rhs)
template<class Dimension, class T>
SI_INLINE_CONSTEXPR quantity< Dimension, T > abs (const quantity< Dimension, T > &x)
template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto dot (const Lhs &lhs, const Rhs &rhs)
template<class Dimension, class T>
SI_INLINE auto normalize (const quantity< Dimension, T > &x)
template<class Dimension, class T>
SI_INLINE auto norm (const quantity< Dimension, T > &x)
template<class T>
SI_INLINE auto distance (const quantity< dimension< 1, 0, 0, 0, 0, 0, 0 >, T > &a, const quantity< dimension< 1, 0, 0, 0, 0, 0, 0 >, T > &b)
template<long Exponent, class Dimension, class T>
SI_INLINE auto pow (const quantity< Dimension, T > &x)
template<long Degree, class Dimension, class T>
SI_INLINE auto root (const quantity< Dimension, T > &x)
template<class Dimension, class T>
SI_INLINE auto sqrt (const quantity< Dimension, T > &x)
template<class Dimension, class T>
SI_INLINE_CONSTEXPR auto deangle (const quantity< Dimension, T > &x)
template<class Value, class Min, class Max>
SI_INLINE_CONSTEXPR auto clamp (const Value &x, const Min &min, const Max &max)
template<class DimensionLhs, class RatioLhs, class DimensionRhs, class RatioRhs>
SI_INLINE_CONSTEXPR auto operator* (unit< DimensionLhs, RatioLhs >, unit< DimensionRhs, RatioRhs >)
template<class DimensionLhs, class RatioLhs, class DimensionRhs, class RatioRhs>
SI_INLINE_CONSTEXPR auto operator/ (unit< DimensionLhs, RatioLhs >, unit< DimensionRhs, RatioRhs >)

Variables

template<class T>
SI_INLINE_CONSTEXPR bool is_dimensionless_v = std::is_same_v<dimensionless, dimension_of_t<T>>
template<class T>
SI_INLINE_CONSTEXPR bool is_si_v = is_si<T>::value
template<class Lhs, class Rhs>
SI_INLINE_CONSTEXPR bool has_common_dimension_v
template<class T>
SI_INLINE_CONSTEXPR long element_count_v = element_count<T>::value

Typedef Documentation

◆ dimension_add

template<class Lhs, class Rhs>
using SI::detail::dimension_add = dimension_add_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>

◆ dimension_add_impl

template<class Lhs, class Rhs>
using SI::detail::dimension_add_impl = SI_DIMENSION_OP(+)

◆ dimension_common

template<class Lhs, class Rhs>
using SI::detail::dimension_common = std::conditional_t<std::is_same_v<Lhs, zero_t>, dimension_of_t<Rhs>, dimension_of_t<Lhs>>

◆ dimension_divide

template<class Lhs, class Rhs>
using SI::detail::dimension_divide = dimension_divide_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>

◆ dimension_divide_impl

template<class Lhs, class Rhs>
using SI::detail::dimension_divide_impl = SI_DIMENSION_OP(/)

◆ dimension_multiply

template<class Lhs, class Rhs>
using SI::detail::dimension_multiply = dimension_multiply_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>

◆ dimension_multiply_impl

template<class Lhs, class Rhs>
using SI::detail::dimension_multiply_impl = SI_DIMENSION_OP(*)

◆ dimension_of_t

template<class T>
using SI::detail::dimension_of_t = typename dimension_of<std::decay_t<T>>::type

◆ dimension_subtract

template<class Lhs, class Rhs>
using SI::detail::dimension_subtract = dimension_subtract_impl <dimension_of_t<Lhs>, dimension_of_t<Rhs>>

◆ dimension_subtract_impl

template<class Lhs, class Rhs>
using SI::detail::dimension_subtract_impl = SI_DIMENSION_OP(-)

◆ dimensionless

◆ enable_for_si

template<class T, class U = void, class V = void>
using SI::detail::enable_for_si = std::enable_if_t<is_si_v<T> || is_si_v<U> || is_si_v<V>>

◆ promoted_scalar_type

template<class T>
using SI::detail::promoted_scalar_type = std::conditional_t<std::is_same_v<scalar_value_type_t<T>, SIdouble>, SIdouble, SIdouble>

◆ scalar_value_type_t

template<class T>
using SI::detail::scalar_value_type_t = typename scalar_value_type<T>::type

◆ value_dimension

template<long Value>
using SI::detail::value_dimension = dimension<Value, Value, Value, Value, Value, Value, Value>

◆ vec2

template<class T>
using SI::detail::vec2 = internal::vec2<T>

◆ vec3

template<class T>
using SI::detail::vec3 = internal::vec3<T>

Function Documentation

◆ abs()

template<class Dimension, class T>
SI_INLINE_CONSTEXPR quantity< Dimension, T > SI::detail::abs ( const quantity< Dimension, T > & x)

◆ clamp()

template<class Value, class Min, class Max>
SI_INLINE_CONSTEXPR auto SI::detail::clamp ( const Value & x,
const Min & min,
const Max & max )

◆ deangle()

template<class Dimension, class T>
SI_INLINE_CONSTEXPR auto SI::detail::deangle ( const quantity< Dimension, T > & x)

◆ distance()

template<class T>
SI_INLINE auto SI::detail::distance ( const quantity< dimension< 1, 0, 0, 0, 0, 0, 0 >, T > & a,
const quantity< dimension< 1, 0, 0, 0, 0, 0, 0 >, T > & b )

◆ dot()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::dot ( const Lhs & lhs,
const Rhs & rhs )

◆ fill()

template<class T>
SI_INLINE_CONSTEXPR std::enable_if_t< std::is_arithmetic_v< T > > SI::detail::fill ( T & x,
T value )

◆ norm()

template<class Dimension, class T>
SI_INLINE auto SI::detail::norm ( const quantity< Dimension, T > & x)

◆ normalize()

template<class Dimension, class T>
SI_INLINE auto SI::detail::normalize ( const quantity< Dimension, T > & x)

◆ operator!=()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator!= ( const Lhs & lhs,
const Rhs & rhs )

◆ operator*() [1/2]

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator* ( const Lhs & lhs,
const Rhs & rhs )

◆ operator*() [2/2]

template<class DimensionLhs, class RatioLhs, class DimensionRhs, class RatioRhs>
SI_INLINE_CONSTEXPR auto SI::detail::operator* ( unit< DimensionLhs, RatioLhs > ,
unit< DimensionRhs, RatioRhs >  )

◆ operator*=()

template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & SI::detail::operator*= ( quantity< Dimension, T > & lhs,
const U & rhs )

◆ operator+()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator+ ( const Lhs & lhs,
const Rhs & rhs )

◆ operator+=()

template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & SI::detail::operator+= ( quantity< Dimension, T > & lhs,
const U & rhs )

◆ operator-() [1/2]

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator- ( const Lhs & lhs,
const Rhs & rhs )

◆ operator-() [2/2]

template<class T, class Dimension>
SI_INLINE_CONSTEXPR quantity< Dimension, T > SI::detail::operator- ( quantity< Dimension, T > x)

◆ operator-=()

template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & SI::detail::operator-= ( quantity< Dimension, T > & lhs,
const U & rhs )

◆ operator/() [1/2]

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator/ ( const Lhs & lhs,
const Rhs & rhs )

◆ operator/() [2/2]

template<class DimensionLhs, class RatioLhs, class DimensionRhs, class RatioRhs>
SI_INLINE_CONSTEXPR auto SI::detail::operator/ ( unit< DimensionLhs, RatioLhs > ,
unit< DimensionRhs, RatioRhs >  )

◆ operator/=()

template<class T, class Dimension, class U>
SI_INLINE_CONSTEXPR quantity< Dimension, T > & SI::detail::operator/= ( quantity< Dimension, T > & lhs,
const U & rhs )

◆ operator<()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator< ( const Lhs & lhs,
const Rhs & rhs )

◆ operator<=()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator<= ( const Lhs & lhs,
const Rhs & rhs )

◆ operator==()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator== ( const Lhs & lhs,
const Rhs & rhs )

◆ operator>()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator> ( const Lhs & lhs,
const Rhs & rhs )

◆ operator>=()

template<class Lhs, class Rhs, class = enable_for_si<Lhs, Rhs>>
SI_INLINE_CONSTEXPR auto SI::detail::operator>= ( const Lhs & lhs,
const Rhs & rhs )

◆ pow()

template<long Exponent, class Dimension, class T>
SI_INLINE auto SI::detail::pow ( const quantity< Dimension, T > & x)

◆ root()

template<long Degree, class Dimension, class T>
SI_INLINE auto SI::detail::root ( const quantity< Dimension, T > & x)

◆ sqrt()

template<class Dimension, class T>
SI_INLINE auto SI::detail::sqrt ( const quantity< Dimension, T > & x)

◆ value() [1/2]

template<class T, class = std::enable_if_t<!is_si_v<T>>>
SI_INLINE_CONSTEXPR const T & SI::detail::value ( const T & x)

◆ value() [2/2]

SI_INLINE_CONSTEXPR long SI::detail::value ( zero_t )

◆ value2() [1/2]

template<class T, class U>
SI_INLINE_CONSTEXPR decltype(auto) SI::detail::value2 ( T && x,
U  )

◆ value2() [2/2]

template<class U>
SI_INLINE_CONSTEXPR auto SI::detail::value2 ( zero_t ,
const U & other )

Variable Documentation

◆ element_count_v

template<class T>
SI_INLINE_CONSTEXPR long SI::detail::element_count_v = element_count<T>::value

◆ has_common_dimension_v

template<class Lhs, class Rhs>
SI_INLINE_CONSTEXPR bool SI::detail::has_common_dimension_v
Initial value:
=
std::is_same_v<dimension_of_t<Lhs>, dimension_of_t<Rhs>> || std::is_same_v<Lhs, zero_t> || std::is_same_v<Rhs, zero_t>
typename dimension_of< std::decay_t< T > >::type dimension_of_t
Definition internal.h:280

◆ is_dimensionless_v

template<class T>
SI_INLINE_CONSTEXPR bool SI::detail::is_dimensionless_v = std::is_same_v<dimensionless, dimension_of_t<T>>

◆ is_si_v

template<class T>
SI_INLINE_CONSTEXPR bool SI::detail::is_si_v = is_si<T>::value