GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Member Functions | Static Private Member Functions | List of all members
genie::TabulatedLabFrameHadronTensor::TableEntry Class Reference

#include <TabulatedLabFrameHadronTensor.h>

Public Member Functions

TableEntry operator* (double d) const
 
TableEntry operator/ (double d) const
 
TableEntry operator+ (const TableEntry &rhs) const
 
TableEntry operator- (const TableEntry &rhs) const
 
TableEntry operator* (const TableEntry &rhs) const
 
TableEntry operator/ (const TableEntry &rhs) const
 
bool operator== (const TableEntry &rhs) const
 
bool operator!= (const TableEntry &rhs) const
 

Public Attributes

double W00
 
double Wxx
 
double Wzz
 
double ImWxy
 
double ReW0z
 

Protected Member Functions

TableEntry apply_to_elements (double d, double(*my_function)(double, double)) const
 
TableEntry apply_to_elements (const TableEntry &rhs, double(*my_function)(double, double)) const
 

Static Private Member Functions

static double add (double x, double y)
 
static double subtract (double x, double y)
 
static double multiply (double x, double y)
 
static double divide (double x, double y)
 

Detailed Description

Definition at line 93 of file TabulatedLabFrameHadronTensor.h.

Member Function Documentation

static double genie::TabulatedLabFrameHadronTensor::TableEntry::add ( double  x,
double  y 
)
inlinestaticprivate
Todo:
Replace these with lambdas (or something similar) when GENIE updates to C++11. This technique is a bit of a hack.

Definition at line 173 of file TabulatedLabFrameHadronTensor.h.

Referenced by operator+().

173 { return x + y; }
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::apply_to_elements ( double  d,
double(*)(double, double)  my_function 
) const
inlineprotected

Definition at line 138 of file TabulatedLabFrameHadronTensor.h.

References ImWxy, ReW0z, W00, Wxx, and Wzz.

Referenced by operator*(), operator+(), operator-(), and operator/().

140  {
141  // Create a new TableEntry object by applying the function to
142  // each pair of elements
143  TableEntry result;
144  result.W00 = (*my_function)( this->W00, d );
145  result.Wxx = (*my_function)( this->Wxx, d );
146  result.Wzz = (*my_function)( this->Wzz, d );
147  result.ImWxy = (*my_function)( this->ImWxy, d );
148  result.ReW0z = (*my_function)( this->ReW0z, d );
149 
150  return result;
151  }
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::apply_to_elements ( const TableEntry rhs,
double(*)(double, double)  my_function 
) const
inlineprotected

Definition at line 153 of file TabulatedLabFrameHadronTensor.h.

References ImWxy, ReW0z, W00, Wxx, and Wzz.

155  {
156  // Create a new TableEntry object by applying the function to
157  // each pair of elements
158  TableEntry result;
159  result.W00 = (*my_function)( this->W00, rhs.W00 );
160  result.Wxx = (*my_function)( this->Wxx, rhs.Wxx );
161  result.Wzz = (*my_function)( this->Wzz, rhs.Wzz );
162  result.ImWxy = (*my_function)( this->ImWxy, rhs.ImWxy );
163  result.ReW0z = (*my_function)( this->ReW0z, rhs.ReW0z );
164  return result;
165  }
static double genie::TabulatedLabFrameHadronTensor::TableEntry::divide ( double  x,
double  y 
)
inlinestaticprivate

Definition at line 176 of file TabulatedLabFrameHadronTensor.h.

Referenced by operator/().

176 { return x / y; }
static double genie::TabulatedLabFrameHadronTensor::TableEntry::multiply ( double  x,
double  y 
)
inlinestaticprivate

Definition at line 175 of file TabulatedLabFrameHadronTensor.h.

Referenced by operator*().

175 { return x * y; }
bool genie::TabulatedLabFrameHadronTensor::TableEntry::operator!= ( const TableEntry rhs) const
inline

Definition at line 132 of file TabulatedLabFrameHadronTensor.h.

References operator==().

132  {
133  return !operator==(rhs);
134  }
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator* ( double  d) const
inline

Definition at line 104 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and multiply().

105  { return apply_to_elements(d, &TableEntry::multiply); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator* ( const TableEntry rhs) const
inline

Definition at line 117 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and multiply().

118  { return apply_to_elements(rhs, &TableEntry::multiply); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator+ ( const TableEntry rhs) const
inline

Definition at line 111 of file TabulatedLabFrameHadronTensor.h.

References add(), and apply_to_elements().

112  { return apply_to_elements(rhs, &TableEntry::add); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator- ( const TableEntry rhs) const
inline

Definition at line 114 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and subtract().

115  { return apply_to_elements(rhs, &TableEntry::subtract); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator/ ( double  d) const
inline

Definition at line 107 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and divide().

108  { return apply_to_elements(d, &TableEntry::divide); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator/ ( const TableEntry rhs) const
inline

Definition at line 120 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and divide().

121  { return apply_to_elements(rhs, &TableEntry::divide); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const
bool genie::TabulatedLabFrameHadronTensor::TableEntry::operator== ( const TableEntry rhs) const
inline

Definition at line 123 of file TabulatedLabFrameHadronTensor.h.

References ImWxy, ReW0z, W00, Wxx, and Wzz.

Referenced by operator!=().

123  {
124  bool are_equal = this->W00 == rhs.W00;
125  if ( are_equal ) are_equal = this->Wxx == rhs.Wxx;
126  if ( are_equal ) are_equal = this->Wzz == rhs.Wzz;
127  if ( are_equal ) are_equal = this->ImWxy == rhs.ImWxy;
128  if ( are_equal ) are_equal = this->ReW0z == rhs.ReW0z;
129  return are_equal;
130  }
static double genie::TabulatedLabFrameHadronTensor::TableEntry::subtract ( double  x,
double  y 
)
inlinestaticprivate

Definition at line 174 of file TabulatedLabFrameHadronTensor.h.

Referenced by operator-().

174 { return x - y; }

Member Data Documentation

double genie::TabulatedLabFrameHadronTensor::TableEntry::ImWxy
double genie::TabulatedLabFrameHadronTensor::TableEntry::ReW0z
double genie::TabulatedLabFrameHadronTensor::TableEntry::W00
double genie::TabulatedLabFrameHadronTensor::TableEntry::Wxx
double genie::TabulatedLabFrameHadronTensor::TableEntry::Wzz

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