mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional xorOp, bitXorOp, xorEqOp, bitXorEqOp reduction operators
This commit is contained in:
committed by
Andrew Heather
parent
b0eb74c142
commit
45d527853d
@ -46,7 +46,6 @@ namespace Foam
|
||||
// Assignment operation taking two parameters, returning void.
|
||||
// Alters the value of the first parameter.
|
||||
// Eg, plusEqOp for (x += y)
|
||||
|
||||
#define EqOp(opName, op) \
|
||||
\
|
||||
template<class T1, class T2> \
|
||||
@ -83,8 +82,10 @@ EqOp(maxMagSqrEq, x = (magSqr(x) >= magSqr(y) ? x : y))
|
||||
|
||||
EqOp(andEq, x = (x && y))
|
||||
EqOp(orEq, x = (x || y))
|
||||
EqOp(xorEq, x = (x != y))
|
||||
EqOp(bitAndEq, x = (x & y))
|
||||
EqOp(bitOrEq, x = (x | y))
|
||||
EqOp(bitXorEq, x = (x ^ y))
|
||||
|
||||
EqOp(eqMinus, x = -y)
|
||||
|
||||
@ -223,11 +224,13 @@ Op(minMagSqr, (magSqr(x)<=magSqr(y) ? x : y))
|
||||
Op(maxMagSqr, (magSqr(x)>=magSqr(y) ? x : y))
|
||||
Op(minMod, minMod(x, y))
|
||||
|
||||
Op(bitOr, (x | y))
|
||||
Op(bitAnd, (x & y))
|
||||
Op(bitOr, (x | y))
|
||||
Op(bitXor, (x ^ y))
|
||||
|
||||
BoolOp(and, x && y)
|
||||
BoolOp(or, x || y)
|
||||
BoolOp(or, x || y)
|
||||
BoolOp(xor, x != y) // Or as (!x != !y) to force bool context?
|
||||
BoolOp(equal, x == y)
|
||||
BoolOp(notEqual, x != y)
|
||||
BoolOp(less, x < y)
|
||||
|
||||
Reference in New Issue
Block a user