thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > > Class Template Reference

Public Types

template<long int Num, long int Den>
using Power = Qty< typename std::ratio< Num *L, Den *DL >::type, typename std::ratio< Num *E, Den *DE >::type, typename std::ratio< Num *Q, Den *DQ >::type >
 General power type.
 
using Type = Power< 1, 1 >
 Our type.
 
using Squared = Power< 2, 1 >
 The squared type.
 
using Inverse = Power<-1, 1 >
 The inverse type.
 
using Sqrt = Power< 1, 2 >
 The sqrt type.
 

Public Member Functions

constexpr Qty ()
 Default constructor to 0.
 
constexpr Qty (ZeroUnit)
 Default constructor to 0.
 
template<typename U >
constexpr Qty (const U &q, double factor=1.0, enable_if_same_qty< void, Type, U > *=nullptr)
 Constructor from a compatible quantity.
 
constexpr double rawValue () const
 Access to the raw value. Breaks consistency.
 
Typeoperator*= (double x)
 Assignment multiplication by dimensionless number.
 
Typeoperator/= (double x)
 Assignment division by dimensionless number.
 
Typeoperator+= (const Type &x)
 Assignment addition with compatible quantity.
 
Typeoperator-= (const Type &x)
 Assignment subtraction with compatible quantity.
 

Static Public Member Functions

static std::string className ()
 The name of the class for persistent IO.
 
static constexpr Type baseunit ()
 Basic unit of this quantity.
 

Private Member Functions

constexpr Qty (double val)
 Constructor from raw values. Breaks consistency.
 

Private Attributes

double rawValue_
 The raw value in units of Qty::baseunit().
 

Detailed Description

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
class ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >

Definition at line 76 of file PhysicalQty.h.

Member Typedef Documentation

◆ Inverse

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
using ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Inverse = Power<-1,1>

The inverse type.

Definition at line 108 of file PhysicalQty.h.

◆ Power

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
template<long int Num, long int Den>
using ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Power = Qty<typename std::ratio<Num*L,Den*DL>::type, typename std::ratio<Num*E,Den*DE>::type, typename std::ratio<Num*Q,Den*DQ>::type>

General power type.

Definition at line 100 of file PhysicalQty.h.

◆ Sqrt

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
using ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Sqrt = Power<1,2>

The sqrt type.

Definition at line 110 of file PhysicalQty.h.

◆ Squared

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
using ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Squared = Power<2,1>

The squared type.

Definition at line 106 of file PhysicalQty.h.

◆ Type

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
using ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Type = Power<1,1>

Our type.

Definition at line 104 of file PhysicalQty.h.

Constructor & Destructor Documentation

◆ Qty() [1/4]

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
constexpr ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Qty ( double  val)
inlineconstexprprivate

Constructor from raw values. Breaks consistency.

Definition at line 80 of file PhysicalQty.h.

◆ Qty() [2/4]

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
constexpr ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Qty ( )
inlineconstexpr

Default constructor to 0.

Definition at line 119 of file PhysicalQty.h.

◆ Qty() [3/4]

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
constexpr ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Qty ( ZeroUnit  )
inlineconstexpr

Default constructor to 0.

Definition at line 122 of file PhysicalQty.h.

◆ Qty() [4/4]

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
template<typename U >
constexpr ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::Qty ( const U &  q,
double  factor = 1.0,
enable_if_same_qty< void, Type, U > *  = nullptr 
)
inlineconstexpr

Constructor from a compatible quantity.

Definition at line 126 of file PhysicalQty.h.

Member Function Documentation

◆ baseunit()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
static constexpr Type ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::baseunit ( )
inlinestaticconstexpr

Basic unit of this quantity.

Definition at line 113 of file PhysicalQty.h.

◆ className()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
static std::string ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::className ( )
inlinestatic

The name of the class for persistent IO.

Definition at line 85 of file PhysicalQty.h.

◆ operator*=()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
Type & ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::operator*= ( double  x)
inline

Assignment multiplication by dimensionless number.

Definition at line 134 of file PhysicalQty.h.

◆ operator+=()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
Type & ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::operator+= ( const Type x)
inline

Assignment addition with compatible quantity.

Definition at line 140 of file PhysicalQty.h.

◆ operator-=()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
Type & ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::operator-= ( const Type x)
inline

Assignment subtraction with compatible quantity.

Definition at line 147 of file PhysicalQty.h.

◆ operator/=()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
Type & ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::operator/= ( double  x)
inline

Assignment division by dimensionless number.

Definition at line 137 of file PhysicalQty.h.

◆ rawValue()

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
constexpr double ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::rawValue ( ) const
inlineconstexpr

Access to the raw value. Breaks consistency.

Definition at line 131 of file PhysicalQty.h.

Member Data Documentation

◆ rawValue_

template<long int L, long int E, long int Q, long int DL, long int DE, long int DQ>
double ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >::rawValue_
private

The raw value in units of Qty::baseunit().

Definition at line 155 of file PhysicalQty.h.


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