Class RealOperations

java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.RealOperations

public class RealOperations extends Object
Implements real operations.
Author:
Holger Eichelberger, El-Sharkawy
  • Field Details

  • Constructor Details

    • RealOperations

      private RealOperations()
      Prevents external creation.
  • Method Details

    • register

      public static final void register()
      Registers the defined operations.
    • equalsRealInt

      static EvaluationAccessor equalsRealInt(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean negate)
      Implements the mixed int-real equality operation.
      Parameters:
      operand - the operand
      arguments - the arguments
      negate - whether the result shall be negated
      Returns:
      the comparison result, null if the operation cannot be applied
    • arithmeticOperationReal

      private static EvaluationAccessor arithmeticOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, ArithmeticOperationType type)
      Implements arithmetic operations of two integer variables/values.
      Parameters:
      operand - the operand
      arguments - the arguments
      type - The desired arithmetic operation.
      Returns:
      The result of the arithmetic operation, null if the operation cannot be applied
    • round

      private static EvaluationAccessor round(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean roundUp)
      Implements arithmetic operations of two integer variables/values.
      Parameters:
      operand - the operand
      arguments - the arguments
      roundUp - If true this operation will round commercial (*.5 and higher will be round up), else numbers will be round down in any case.
      Returns:
      The result of the arithmetic operation, null if the operation cannot be applied
    • minmaxOperationReal

      private static EvaluationAccessor minmaxOperationReal(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean min)
      Implements min/max operations of two integer/real variables/values.
      Parameters:
      operand - the operand
      arguments - the arguments
      min - If true the min operation will be applied, max otherwise.
      Returns:
      The min/max of the two parameters, null if the operation cannot be applied