|
ThePEG
1.8.0
|
This template class allows the compiler to check calculations with physical quantities for dimensional correctness. More...
#include <PhysicalQty.h>
Public Types | |
| typedef Qty< 2 *L, 2 *E, 2 *Q, DL, DE, DQ > | Squared |
| The squared type. | |
Public Member Functions | |
| Qty () | |
| Default constructor to 0. | |
| Qty (ZeroUnit) | |
| Default constructor to 0. | |
| template<int DL2, int DE2, int DQ2> | |
| Qty (const Qty< QtyInt< L, DL, DL2 >::I, QtyInt< E, DE, DE2 >::I, QtyInt< Q, DQ, DQ2 >::I, DL2, DE2, DQ2 > &q) | |
| Constructor from a compatible quantity. | |
| double | rawValue () const |
| Access to the raw value. Breaks consistency. | |
| Qty< L, E, Q, DL, DE, DQ > & | operator*= (double x) |
| Assignment multiplication by dimensionless number. | |
| Qty< L, E, Q, DL, DE, DQ > & | operator/= (double x) |
| Assignment division by dimensionless number. | |
| template<int DL2, int DE2, int DQ2> | |
| Qty< L, E, Q, DL, DE, DQ > & | operator+= (const Qty< QtyInt< L, DL, DL2 >::I, QtyInt< E, DE, DE2 >::I, QtyInt< Q, DQ, DQ2 >::I, DL2, DE2, DQ2 > x) |
| Assignment addition with compatible quantity. | |
| template<int DL2, int DE2, int DQ2> | |
| Qty< L, E, Q, DL, DE, DQ > & | operator-= (const Qty< QtyInt< L, DL, DL2 >::I, QtyInt< E, DE, DE2 >::I, QtyInt< Q, DQ, DQ2 >::I, DL2, DE2, DQ2 > x) |
| Assignment subtraction with compatible quantity. | |
Static Public Member Functions | |
| static std::string | className () |
| The name of the class for persistent IO. | |
| static Qty< L, E, Q, DL, DE, DQ > | baseunit () |
| Basic unit of this quantity. | |
Private Member Functions | |
| Qty (double val) | |
| Constructor from raw values. Breaks consistency. | |
Private Attributes | |
| double | rawValue_ |
| The raw value in units of Qty::baseunit(). | |
This template class allows the compiler to check calculations with physical quantities for dimensional correctness.
A quantity can be composed of arbitrary fractional powers of length L, energy E and charge Q. Commonly used quantities should be typedef'ed (see Units.h).
Some member functions can break dimensional consistency if the user is not careful; these are marked explicitly.
Do not use this class directly in ThePEG, use the pre-defined quantities from Units.h or the wrapper in Phys_Qty.h instead.
Definition at line 81 of file PhysicalQty.h.
1.8.9.1