Enum Class Operation

java.lang.Object
java.lang.Enum<Operation>
jromp.parallel.var.reduction.Operation
All Implemented Interfaces:
Serializable, Comparable<Operation>, Constable

public enum Operation extends Enum<Operation>
Enum for reduction operations.
  • Enum Constant Details

    • SUM

      public static final Operation SUM
      Sum reduction operation.
    • MUL

      public static final Operation MUL
      Multiplication reduction operation.
    • BAND

      public static final Operation BAND
      Bitwise AND reduction operation.
    • BOR

      public static final Operation BOR
      Bitwise OR reduction operation.
    • BXOR

      public static final Operation BXOR
      Bitwise XOR reduction operation.
    • LAND

      public static final Operation LAND
      Logical AND reduction operation.
    • LOR

      public static final Operation LOR
      Logical OR reduction operation.
    • MAX

      public static final Operation MAX
      Maximum reduction operation.
    • MIN

      public static final Operation MIN
      Minimum reduction operation.
  • Method Details

    • values

      public static Operation[] 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

      public static Operation valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getOp

      public ReductionOperation getOp()
      Get the operation.
      Returns:
      the operation.
    • getIdentifier

      public String getIdentifier()
      Get the identifier of the operation.
      Returns:
      the identifier of the operation.
    • initialize

      public <T extends Serializable> void initialize(Variable<T> variable)
      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

      public <T extends Serializable> T combine(T a, T b)
      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

      public static ReductionOperation fromIdentifier(String identifier)
      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.