thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
PhysicalQty.h File Reference

The PhysicalQty class allows compile-time checking of dimensional correctness. More...

#include "TemplateTools.h"
#include <sstream>
#include <ratio>
#include <type_traits>

Go to the source code of this file.

Classes

struct  ThePEG::ZeroUnit
 Helper class to construct zero unitful quantities. More...
 
class  ThePEG::Qty< L, E, T >
 This template class allows the compiler to check calculations with physical quantities for dimensional correctness. More...
 
struct  ThePEG::qty_equal< T, U >
 
struct  ThePEG::qty_equal< Qty< L1, E1, Q1 >, Qty< L2, E2, Q2 > >
 
struct  ThePEG::is_qty< T >
 
class  ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >
 
class  ThePEG::Qty< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 Specialization of Qty for <0,0,0> with conversions to double. More...
 
struct  ThePEG::BinaryOpTraits< T, U >
 BinaryOpTraits should be specialized with typdefs called MulT and DivT which gives the type resulting when multiplying and dividing the template argument types respectively. More...
 

Namespaces

 ThePEG
 This is the main namespace within which all identifiers in ThePEG are declared.
 

Typedefs

template<typename ResultT , typename T , typename U = T>
using ThePEG::enable_if_same_qty = typename std::enable_if< qty_equal< T, U >::value, ResultT >::type
 
using ThePEG::QtyDouble = Qty< std::ratio< 0 >, std::ratio< 0 >, std::ratio< 0 > >
 

Variables

constexpr ZeroUnit ThePEG::ZERO = ZeroUnit()
 ZERO can be used as zero for any unitful quantity.
 

Detailed Description

The PhysicalQty class allows compile-time checking of dimensional correctness.

Mathematical operations that are inconsistent are flagged as type errors.

Do not use the classes directly in ThePEG, use the wrappers defined in Units.h or Phys_Qty.h instead.

Definition in file PhysicalQty.h.