Package jromp.parallel.var.reduction
Enum Class Operation
- All Implemented Interfaces:
Serializable
,Comparable<Operation>
,Constable
Enum for reduction operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBitwise AND reduction operation.Bitwise OR reduction operation.Bitwise XOR reduction operation.Logical AND reduction operation.Logical OR reduction operation.Maximum reduction operation.Minimum reduction operation.Multiplication reduction operation.Sum reduction operation. -
Method Summary
Modifier and TypeMethodDescription<T extends Serializable>
Tcombine
(T a, T b) Combines two values of the reduction operation.static ReductionOperation
fromIdentifier
(String identifier) Returns the reduction operation corresponding to the given identifier.Get the identifier of the operation.getOp()
Get the operation.<T extends Serializable>
voidinitialize
(Variable<T> variable) Initializes the variable with the identity value of the reduction operation.static Operation
Returns the enum constant of this class with the specified name.static Operation[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUM
Sum reduction operation. -
MUL
Multiplication reduction operation. -
BAND
Bitwise AND reduction operation. -
BOR
Bitwise OR reduction operation. -
BXOR
Bitwise XOR reduction operation. -
LAND
Logical AND reduction operation. -
LOR
Logical OR reduction operation. -
MAX
Maximum reduction operation. -
MIN
Minimum reduction operation.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getOp
Get the operation.- Returns:
- the operation.
-
getIdentifier
Get the identifier of the operation.- Returns:
- the identifier of the operation.
-
initialize
Initializes the variable with the identity value of the reduction operation.- Type Parameters:
T
- the type of the variable.- Parameters:
variable
- the variable to initialize.
-
combine
Combines two values of the reduction operation.- Type Parameters:
T
- the type of the values to combine.- Parameters:
a
- the first value.b
- the second value.- Returns:
- the result of the combination.
-
fromIdentifier
Returns the reduction operation corresponding to the given identifier.- Parameters:
identifier
- the identifier of the reduction operation.- Returns:
- the reduction operation corresponding to the identifier, or null if not found.
-