30#define G4MergeMode_h 1
58 switch ( mergeMode ) {
59 case G4MergeMode::kAddition:
61 return [](
const T& x,
const T& y) {
return x + y; };
63 case G4MergeMode::kMultiplication:
64 return [](
const T& x,
const T& y) {
return x * y; };
66 case G4MergeMode::kMaximum:
68 return [](
const T& x,
const T& y) {
return std::max(x,y); };
70 case G4MergeMode::kMinimum:
72 return [](
const T& x,
const T& y) {
return std::min(x,y); };
75 return [](
const T&,
const T&) {
return 0.0; };
82 switch ( mergeMode ) {
83 case G4MergeMode::kAddition:
84 case G4MergeMode::kMaximum:
86 return [](
const G4bool& x,
const G4bool& y) {
return x || y; };
88 case G4MergeMode::kMultiplication:
89 case G4MergeMode::kMinimum:
90 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)