tfel
Loading...
Searching...
No Matches
qtOperations.ixx File Reference

This file implements usual operations on quantities. More...

Namespaces

namespace  tfel
 the namespace tfel encloses all the TFEL project. This namespace is empty.
namespace  tfel::math
 This namespace contains various classes and functions défining mathematical objects and numerical algorithms.

Macros

#define LIB_TFEL_MATH_QTOPERATIONS_IXX
#define TFEL_MATH_QT_SCALAR_OPERATIONS_IMPL1(Op)

Functions

template<ImmutableQuantityConcept QuantityType, StandardArithmeticTypeConcept ScalarType>
TFEL_HOST_DEVICE constexpr auto tfel::math::operator* (const QuantityType &lhs, const ScalarType &rhs) noexcept
template<StandardArithmeticTypeConcept ScalarType, ImmutableQuantityConcept QuantityType>
TFEL_HOST_DEVICE constexpr auto tfel::math::operator* (const ScalarType &lhs, const QuantityType &rhs) noexcept
template<ImmutableQuantityConcept QuantityType, StandardArithmeticTypeConcept ScalarType>
TFEL_HOST_DEVICE constexpr auto tfel::math::operator/ (const QuantityType &lhs, const ScalarType &rhs) noexcept
template<StandardArithmeticTypeConcept ScalarType, ImmutableQuantityConcept QuantityType>
TFEL_HOST_DEVICE constexpr auto tfel::math::operator/ (const ScalarType &lhs, const QuantityType &rhs) noexcept

Detailed Description

This file implements usual operations on quantities.

Author
Thomas Helfer
Date
07 Jun 2006

Macro Definition Documentation

◆ TFEL_MATH_QT_SCALAR_OPERATIONS_IMPL1

#define TFEL_MATH_QT_SCALAR_OPERATIONS_IMPL1 ( Op)
Value:
\
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto operator Op( \
const QuantityType& lhs, \
const ScalarType& \
rhs) noexcept requires(NoUnitImmutableQuantityConcept<QuantityType>) { \
return qt<unit::NoUnit, typename tfel::typetraits::Promote< \
base_type<QuantityType>, ScalarType>::type>{ \
base_type_cast(lhs) Op rhs}; \
} \
\
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto operator Op( \
const ScalarType& lhs, \
const QuantityType& \
rhs) noexcept requires(NoUnitImmutableQuantityConcept<QuantityType>) { \
return qt<unit::NoUnit, typename tfel::typetraits::Promote< \
base_type<QuantityType>, ScalarType>::type>{ \
lhs Op base_type_cast(rhs)}; \
}
TFEL_HOST_DEVICE constexpr decltype(auto) base_type_cast(const Quantity< UnitType, ValueType, OwnershipPolicy > &v) noexcept
cast the value to the base type
Definition qt.hxx:531
Returns the greater type able to contain the type A and B.
Definition Promote.ixx:340