![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Physical constants in a unit system. More...
#include <shamunits/include/shamunits/Constants.hpp>
Public Member Functions | |
| constexpr | Constants (const UnitSystem< T > units) |
| Construct the shamunits::Constants class with a unit system. | |
| template<Unit u, class Tret = T> | |
| constexpr Tret | get () const noexcept |
| template<class Tret = T, class Tu> | |
| constexpr Tret | get (Unit< Tu > u) const noexcept |
| Value of a constant only known at run time, e.g. get(constants::from_name("G")). | |
| template<class Tret = T, class Tu> | |
| constexpr Tret | get (Unit< Tu > u, int power) const noexcept |
| get(u) raised to a runtime power: the Python path, Constants(usys).G(power=2) | |
Public Attributes | |
| const UnitSystem< T > | units |
| Current unit system of the constants. | |
Physical constants in a unit system.
Definition at line 58 of file Constants.hpp.
|
inlineexplicitconstexpr |
Construct the shamunits::Constants class with a unit system.
Definition at line 64 of file Constants.hpp.
|
inlineconstexprnoexcept |
Value of the constant (or unit) u in this unit system, e.g. get<constants::G>(). Same as units.get<u, Tret>(); see UnitSystem::get.
Definition at line 69 of file Constants.hpp.
|
inlineconstexprnoexcept |
Value of a constant only known at run time, e.g. get(constants::from_name("G")).
Definition at line 75 of file Constants.hpp.
|
inlineconstexprnoexcept |
get(u) raised to a runtime power: the Python path, Constants(usys).G(power=2)
Definition at line 81 of file Constants.hpp.
| const UnitSystem<T> shamunits::Constants< T >::units |
Current unit system of the constants.
Definition at line 61 of file Constants.hpp.