tfel
Loading...
Searching...
No Matches
tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy > Struct Template Reference
Inheritance diagram for tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >:

Classes

struct  IsQtScalarOperationValid

Public Types

template<StandardArithmeticTypeConcept ValueType1, StandardArithmeticTypeConcept ValueType2>
using promote
 a simple alias
using value_type = ValueType
 a simple alias

Public Member Functions

template<ImmutableQuantityConcept OtherQuantityType>
requires ( (unit::areUnitsEqual<UnitType, quantity_unit<OtherQuantityType>>)&&( std::is_same_v<promote<ValueType, base_type<OtherQuantityType>>, ValueType>))
TFEL_HOST_DEVICE constexpr Quantity (const OtherQuantityType &src) noexcept
template<StandardArithmeticTypeConcept T>
requires ((std::is_constructible_v<ValueType, T>)&& // (std::is_convertible_v<ValueType, T>)&& // (unit::areUnitsEqual<UnitType, unit::NoUnit>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator= (const T &src) noexcept
template<StandardArithmeticTypeConcept T>
requires ((std::is_constructible_v<ValueType, T>)&& // (std::is_convertible_v<ValueType, T>)&& // (unit::areUnitsEqual<UnitType, unit::NoUnit>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator+= (const T &src) noexcept
template<StandardArithmeticTypeConcept T>
requires ((std::is_constructible_v<ValueType, T>)&& // (std::is_convertible_v<ValueType, T>)&& // (unit::areUnitsEqual<UnitType, unit::NoUnit>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator-= (const T &src) noexcept
template<ImmutableQuantityConcept OtherQuantityType>
requires ( (unit::areUnitsEqual<UnitType, quantity_unit<OtherQuantityType>>)&&( std::is_same_v<promote<ValueType, base_type<OtherQuantityType>>, ValueType>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator= (const OtherQuantityType &src) noexcept
 assignement operator
template<ImmutableQuantityConcept OtherQuantityType>
requires ( (unit::areUnitsEqual<UnitType, quantity_unit<OtherQuantityType>>)&&( std::is_same_v<promote<ValueType, base_type<OtherQuantityType>>, ValueType>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator+= (const OtherQuantityType &src) noexcept
 operator +=
template<ImmutableQuantityConcept OtherQuantityType>
requires ( (unit::areUnitsEqual<UnitType, quantity_unit<OtherQuantityType>>)&&( std::is_same_v<promote<ValueType, base_type<OtherQuantityType>>, ValueType>)&& // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator-= (const OtherQuantityType &src) noexcept
 operator -=
template<StandardArithmeticTypeConcept ValueType2>
requires ((IsQtScalarOperationValid<ValueType, ValueType2>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator*= (const ValueType2 &a) noexcept
 multiplication by a scalar
template<NoUnitImmutableQuantityConcept OtherQuantityType>
requires ( (IsQtScalarOperationValid<ValueType, base_type<OtherQuantityType>>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator*= (const OtherQuantityType &a) noexcept
 multiplication by a scalar
template<StandardArithmeticTypeConcept ValueType2>
requires ((IsQtScalarOperationValid<ValueType, ValueType2>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator/= (const ValueType2 &a) noexcept
 division by a scalar
template<NoUnitImmutableQuantityConcept OtherQuantityType>
requires ( (IsQtScalarOperationValid<ValueType, base_type<OtherQuantityType>>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & operator/= (const OtherQuantityType &a) noexcept
 division by a scalar
TFEL_HOST_DEVICE constexpr qt< UnitType, ValueType > operator- () const noexcept
 negation operator

Static Public Attributes

static constexpr auto is_mutable

Member Typedef Documentation

◆ promote

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
template<StandardArithmeticTypeConcept ValueType1, StandardArithmeticTypeConcept ValueType2>
using tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::promote
Initial value:
typename tfel::typetraits::internals::ChooseType< A, B, std::numeric_limits< A >::is_signed, std::numeric_limits< B >::is_signed >::type type
result
Definition Promote.ixx:342

a simple alias

Member Function Documentation

◆ operator*=() [1/2]

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
template<NoUnitImmutableQuantityConcept OtherQuantityType>
requires ( (IsQtScalarOperationValid<ValueType, base_type<OtherQuantityType>>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::operator*= ( const OtherQuantityType & a)
inlineconstexprnoexcept

multiplication by a scalar

Template Parameters
ValueType2another numeric type
Parameters
[in]aa scalar

◆ operator*=() [2/2]

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
template<StandardArithmeticTypeConcept ValueType2>
requires ((IsQtScalarOperationValid<ValueType, ValueType2>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::operator*= ( const ValueType2 & a)
inlineconstexprnoexcept

multiplication by a scalar

Template Parameters
ValueType2another numeric type
Parameters
[in]aa scalar

◆ operator/=() [1/2]

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
template<NoUnitImmutableQuantityConcept OtherQuantityType>
requires ( (IsQtScalarOperationValid<ValueType, base_type<OtherQuantityType>>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::operator/= ( const OtherQuantityType & a)
inlineconstexprnoexcept

division by a scalar

Template Parameters
ValueType2another numeric type
Parameters
[in]aa scalar

◆ operator/=() [2/2]

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
template<StandardArithmeticTypeConcept ValueType2>
requires ((IsQtScalarOperationValid<ValueType, ValueType2>::cond) && // (is_mutable))
TFEL_HOST_DEVICE constexpr Quantity & tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::operator/= ( const ValueType2 & a)
inlineconstexprnoexcept

division by a scalar

Template Parameters
ValueType2another numeric type
Parameters
[in]aa scalar

Member Data Documentation

◆ is_mutable

template<unit::UnitConcept UnitType, StandardArithmeticTypeConcept ValueType, typename OwnershipPolicy>
auto tfel::math::Quantity< UnitType, ValueType, OwnershipPolicy >::is_mutable
staticconstexpr
Initial value:
= requires(OwnershipPolicy & p) {
{ p.getValue() } -> std::same_as<ValueType&>;
}

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