31 #define G4MergeMode_h 1
52 namespace G4Accumulables {
59 switch ( mergeMode ) {
62 return [](
const T&
x,
const T& y) {
return x + y; };
65 return [](
const T&
x,
const T& y) {
return x * y; };
69 return [](
const T&
x,
const T& y) {
return std::max(x,y); };
73 return [](
const T&
x,
const T& y) {
return std::min(x,y); };
80 switch ( mergeMode ) {
84 return [](
const G4bool&
x,
const G4bool& y) {
return x || y; };
88 return [](
const G4bool&
x,
const G4bool& y) {
return x && y; };
std::function< T(const T &, const T &)> G4MergeFunction
G4MergeFunction< T > GetMergeFunction(G4MergeMode mergeMode)
G4MergeMode GetMergeMode(const G4String &mergeModeName)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments