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

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

Classes

struct  tfel::math::ComputeUnaryOperationResult< ScalarTag, UnaryOperatorTag, T, OpNeg >
struct  tfel::math::ResultType< T1, T2, OpPlus >
 partial specialisation for addition of two quantity objects having the same unit More...
struct  tfel::math::ResultType< T1, T2, OpMinus >
 partial specialisation for subtraction of two quantity objects having the same unit More...
struct  tfel::math::ResultType< T1, T2, OpMult >
 partial specialisation for multiplication of two quantity objects More...
struct  tfel::math::ResultType< T1, T2, OpDiv >
 partial specialisation for division of two quantity objects More...
struct  tfel::math::ResultType< ScalarType, QuantityType, OpPlus >
 partial specialisation for fundamental numeric type and a quantity with no unit More...
struct  tfel::math::ResultType< QuantityType, ScalarType, OpPlus >
 partial specialisation for a quantity with no unit and a fundamental numeric type More...
struct  tfel::math::ResultType< ScalarType, QuantityType, OpMinus >
 partial specialisation for fundamental numeric type and a quantity with no unit More...
struct  tfel::math::ResultType< QuantityType, ScalarType, OpMinus >
 partial specialisation for a quantity with no unit and a fundamental numeric type More...
struct  tfel::math::ResultType< ScalarType, QuantityType, OpMult >
 partial specialisation for fundamental numeric type and a quantity with no unit More...
struct  tfel::math::ResultType< QuantityType, ScalarType, OpMult >
 partial specialisation for a quantity with no unit and a fundamental numeric type More...
struct  tfel::math::ResultType< ScalarType, QuantityType, OpDiv >
 partial specialisation for fundamental numeric type and a quantity with no unit More...
struct  tfel::math::ResultType< QuantityType, ScalarType, OpDiv >
 partial specialisation for a quantity with no unit and a fundamental numeric type 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 TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS(Op)
#define TFEL_MATH_QT_SCALAR_OPERATIONS(Op)
#define TFEL_MATH_QT_SCALAR_OPERATIONS2(Op)

Functions

template<ImmutableQuantityConcept QuantityType>
TFEL_HOST_DEVICE constexpr auto tfel::math::operator- (const QuantityType &q) noexcept
 negation operator
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator< (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator< (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator<= (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator<= (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator> (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator> (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator>= (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator>= (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator== (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator== (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator!= (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr bool tfel::math::operator!= (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr auto tfel::math::operator+ (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr auto tfel::math::operator+ (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr auto tfel::math::operator- (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
requires (!std::is_same_v<quantity_unit<T1>, quantity_unit<T2>>)
TFEL_HOST_DEVICE constexpr auto tfel::math::operator- (const T1 &a, const T2 &b) noexcept=delete
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
constexpr auto tfel::math::operator* (const T1 &a, const T2 &b) noexcept
template<ImmutableQuantityConcept T1, ImmutableQuantityConcept T2>
constexpr auto tfel::math::operator/ (const T1 &a, const T2 &b) noexcept
 tfel::math::TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS (<)
 tfel::math::TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS (<=)
 tfel::math::TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS (>=)
 tfel::math::TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS (!=)
 tfel::math::TFEL_MATH_QT_SCALAR_OPERATIONS (+)
 tfel::math::TFEL_MATH_QT_SCALAR_OPERATIONS (-)

Detailed Description

This file declares usual operations on quantities.

Author
Thomas Helfer
Date
07/06/2006

Macro Definition Documentation

◆ TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS

#define TFEL_MATH_QT_NOUNIT_COMPARISION_OPERATORS ( Op)
Value:
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
TFEL_HOST_DEVICE constexpr bool \
operator Op(const QuantityType& a, const ScalarType& b) noexcept requires( \
NoUnitImmutableQuantityConcept<QuantityType>) { \
return base_type_cast(a) Op b; \
} \
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
TFEL_HOST_DEVICE constexpr bool \
operator Op(const QuantityType& a, const ScalarType& b) noexcept requires( \
!NoUnitImmutableQuantityConcept<QuantityType>) = \
delete /* ("invalid operation (unmatched unit)") */; \
\
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
TFEL_HOST_DEVICE constexpr bool \
operator Op(const ScalarType& a, const QuantityType& b) noexcept requires( \
NoUnitImmutableQuantityConcept<QuantityType>) { \
return a Op base_type_cast(b); \
} \
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
TFEL_HOST_DEVICE constexpr bool \
operator Op(const ScalarType& a, const QuantityType& b) noexcept requires( \
!NoUnitImmutableQuantityConcept<QuantityType>) = \
delete /*("invalid operation (unmatched unit)") */

◆ TFEL_MATH_QT_SCALAR_OPERATIONS

#define TFEL_MATH_QT_SCALAR_OPERATIONS ( Op)
Value:
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto \
operator Op(const QuantityType&, const ScalarType&) noexcept requires( \
NoUnitImmutableQuantityConcept<QuantityType>); \
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto \
operator Op(const QuantityType&, const ScalarType&) noexcept requires( \
!NoUnitImmutableQuantityConcept<QuantityType>) = \
delete /* ("invalid operation (unmatched unit)") */; \
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto \
operator Op(const ScalarType&, const QuantityType&) noexcept requires( \
NoUnitImmutableQuantityConcept<QuantityType>); \
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto \
operator Op(const ScalarType&, const QuantityType&) noexcept requires( \
!NoUnitImmutableQuantityConcept<QuantityType>) = \
delete /* ("invalid operation (unmatched unit)") */

◆ TFEL_MATH_QT_SCALAR_OPERATIONS2

#define TFEL_MATH_QT_SCALAR_OPERATIONS2 ( Op)
Value:
template <ImmutableQuantityConcept QuantityType, \
StandardArithmeticTypeConcept ScalarType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto operator Op( \
const QuantityType&, const ScalarType&) noexcept; \
template <StandardArithmeticTypeConcept ScalarType, \
ImmutableQuantityConcept QuantityType> \
[[nodiscard]] TFEL_HOST_DEVICE constexpr auto operator Op( \
const ScalarType&, const QuantityType&) noexcept