GENIEGenerator
Loading...
Searching...
No Matches
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

◆ add()

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.

173{ return x + y; }

Referenced by operator+().

◆ apply_to_elements() [1/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::apply_to_elements ( const TableEntry & rhs,
double(* my_function )(double, double) ) const
inlineprotected

Definition at line 153 of file TabulatedLabFrameHadronTensor.h.

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 }

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

◆ apply_to_elements() [2/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::apply_to_elements ( double d,
double(* my_function )(double, double) ) const
inlineprotected

Definition at line 138 of file TabulatedLabFrameHadronTensor.h.

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 }

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

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

◆ divide()

double genie::TabulatedLabFrameHadronTensor::TableEntry::divide ( double x,
double y )
inlinestaticprivate

Definition at line 176 of file TabulatedLabFrameHadronTensor.h.

176{ return x / y; }

Referenced by operator/(), and operator/().

◆ multiply()

double genie::TabulatedLabFrameHadronTensor::TableEntry::multiply ( double x,
double y )
inlinestaticprivate

Definition at line 175 of file TabulatedLabFrameHadronTensor.h.

175{ return x * y; }

Referenced by operator*(), and operator*().

◆ operator!=()

bool genie::TabulatedLabFrameHadronTensor::TableEntry::operator!= ( const TableEntry & rhs) const
inline

Definition at line 132 of file TabulatedLabFrameHadronTensor.h.

132 {
133 return !operator==(rhs);
134 }

References operator==().

◆ operator*() [1/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator* ( const TableEntry & rhs) const
inline

Definition at line 117 of file TabulatedLabFrameHadronTensor.h.

118 { return apply_to_elements(rhs, &TableEntry::multiply); }
TableEntry apply_to_elements(double d, double(*my_function)(double, double)) const

References apply_to_elements(), and multiply().

◆ operator*() [2/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator* ( double d) const
inline

Definition at line 104 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and multiply().

◆ operator+()

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator+ ( const TableEntry & rhs) const
inline

Definition at line 111 of file TabulatedLabFrameHadronTensor.h.

References add(), and apply_to_elements().

◆ operator-()

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator- ( const TableEntry & rhs) const
inline

Definition at line 114 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and subtract().

◆ operator/() [1/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator/ ( const TableEntry & rhs) const
inline

Definition at line 120 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and divide().

◆ operator/() [2/2]

TableEntry genie::TabulatedLabFrameHadronTensor::TableEntry::operator/ ( double d) const
inline

Definition at line 107 of file TabulatedLabFrameHadronTensor.h.

References apply_to_elements(), and divide().

◆ operator==()

bool genie::TabulatedLabFrameHadronTensor::TableEntry::operator== ( const TableEntry & rhs) const
inline

Definition at line 123 of file TabulatedLabFrameHadronTensor.h.

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 }

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

Referenced by operator!=().

◆ subtract()

double genie::TabulatedLabFrameHadronTensor::TableEntry::subtract ( double x,
double y )
inlinestaticprivate

Definition at line 174 of file TabulatedLabFrameHadronTensor.h.

174{ return x - y; }

Referenced by operator-().

Member Data Documentation

◆ ImWxy

◆ ReW0z

◆ W00

◆ Wxx

◆ Wzz


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