|
Celeritas 0.7+87b8fd5
|
#include <type_traits>#include "corecel/Macros.hh"#include "corecel/Types.hh"#include "detail/QuantityImpl.hh"#include <ostream>Classes | |
| class | celeritas::Quantity< UnitT, ValueT > |
| A numerical value tagged with a unit. More... | |
Macros | |
| #define | CELER_DEFINE_QUANTITY_CMP(TOKEN) |
Typedefs | |
| template<class UnitT > | |
| using | celeritas::RealQuantity = Quantity< UnitT, real_type > |
| Type alias for a quantity that uses compile-time precision. | |
Functions | |
| constexpr auto | celeritas::zero_quantity () noexcept |
| Get a typeless zero quantity. | |
| constexpr auto | celeritas::max_quantity () noexcept |
| Get a typeless quantity greater than any other numeric quantity. | |
| constexpr auto | celeritas::neg_max_quantity () noexcept |
| Get a quantity less than any other numeric quantity. | |
| template<class U , class V > | |
| constexpr void | celeritas::swap (Quantity< U, V > &a, Quantity< U, V > &b) noexcept |
| Swap two Quantities. | |
| template<class UnitT , class ValueT > | |
| constexpr auto | celeritas::native_value_from (Quantity< UnitT, ValueT > quant) noexcept |
| Convert the given quantity into the native Celeritas unit system. | |
| template<class Q , class T > | |
| constexpr Q | celeritas::native_value_to (T value) noexcept |
| Create a quantity from a value in the Celeritas unit system. | |
| template<class Q , class SrcUnitT , class ValueT > | |
| constexpr auto | celeritas::value_as (Quantity< SrcUnitT, ValueT > quant) noexcept -> ValueT |
| Use the value of a Quantity. | |
| template<class T > | |
| char const * | celeritas::accessor_unit_label () |
| Get the label for a unit returned from a class accessor. | |
| template<class UnitT , class ValueT > | |
| std::ostream & | celeritas::operator<< (std::ostream &os, Quantity< UnitT, ValueT > const &q) |
| Output a quantity with its label. | |
| template<class U , class T > | |
| constexpr T const * | celeritas::ldg_data (Quantity< U, T > const *ptr) noexcept |
| Cached const global loading support for Quantity. | |
Variables | |
| template<class T > | |
| constexpr bool | celeritas::is_quantity_v = detail::IsQuantity<T>::value |
| True if T is a Quantity. | |
| #define CELER_DEFINE_QUANTITY_CMP | ( | TOKEN | ) |
|
inline |
Get the label for a unit returned from a class accessor.
Example:
|
inlineconstexprnoexcept |
Convert the given quantity into the native Celeritas unit system.
|
inlineconstexprnoexcept |
Create a quantity from a value in the Celeritas unit system.
This function can be used for defining a constant for use in another unit system (typically a "natural" unit system for use in physics kernels).
An extra cast may be needed when mixing float, double, and celeritas::Constant.
|
inlineconstexprnoexcept |
Use the value of a Quantity.
The redundant unit type in the function signature is to make coupling safer across different parts of the code and to make the user code more readable.
|
inlineconstexprnoexcept |
Get a typeless zero quantity.
The zero quantity can be compared against any Quantity.