30#define G4MergeMode_h 1
59 switch ( mergeMode ) {
60 case G4MergeMode::kAddition:
62 return [](
const T& x,
const T& y) {
return x + y; };
64 case G4MergeMode::kMultiplication:
65 return [](
const T& x,
const T& y) {
return x * y; };
67 case G4MergeMode::kMaximum:
69 return [](
const T& x,
const T& y) {
return std::max(x,y); };
71 case G4MergeMode::kMinimum:
73 return [](
const T& x,
const T& y) {
return std::min(x,y); };
79 "Undefined merge mode");
80 return [](
const T&,
const T&) {
return T(); };
86 switch ( mergeMode ) {
87 case G4MergeMode::kAddition:
88 case G4MergeMode::kMaximum:
90 return [](
const G4bool& x,
const G4bool& y) {
return x || y; };
92 case G4MergeMode::kMultiplication:
93 case G4MergeMode::kMinimum:
94 return [](
const G4bool& x,
const G4bool& y) {
return x && y; };
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::function< T(const T &, const T &)> G4MergeFunction
G4MergeFunction< T > GetMergeFunction(G4MergeMode mergeMode)
G4MergeMode GetMergeMode(const G4String &mergeModeName)