ThePEG::Qty< L, E, Q, DL, DE, DQ > Class Template Reference

This template class allows the compiler to check calculations with physical quantities for dimensional correctness. More...

#include <PhysicalQty.h>

List of all members.

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 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().


Detailed Description

template<int L, int E, int Q, int DL = 1, int DE = 1, int DQ = 1>
class ThePEG::Qty< L, E, Q, DL, DE, DQ >

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 80 of file PhysicalQty.h.


The documentation for this class was generated from the following file:

Generated on Thu Apr 29 12:42:57 2010 for ThePEG by  doxygen 1.5.5