Class SDValidation


  • public class SDValidation
    extends Object
    • Method Detail

      • validateNumerical

        protected static void validateNumerical​(String opName,
                                                SDVariable v)
        Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to perform operation on
      • validateNumerical

        protected static void validateNumerical​(String opName,
                                                String inputName,
                                                SDVariable v)
        Validate that the operation is being applied on a numerical SDVariable (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateNumerical

        protected static void validateNumerical​(String opName,
                                                String inputName,
                                                SDVariable[] vars)
      • validateNumerical

        protected static void validateNumerical​(String opName,
                                                SDVariable v1,
                                                SDVariable v2)
        Validate that the operation is being applied on numerical SDVariables (not boolean or utf8). Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays
        Parameters:
        opName - Operation name to print in the exception
        v1 - Variable to validate datatype for (input to operation)
        v2 - Variable to validate datatype for (input to operation)
      • validateInteger

        protected static void validateInteger​(String opName,
                                              SDVariable v)
        Validate that the operation is being applied on an integer type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateInteger

        protected static void validateInteger​(String opName,
                                              String inputName,
                                              SDVariable v)
        Validate that the operation is being applied on an integer type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateInteger

        protected static void validateInteger​(String opName,
                                              String inputName,
                                              SDVariable[] vars)
      • validateFloatingPoint

        protected static void validateFloatingPoint​(String opName,
                                                    SDVariable v)
        Validate that the operation is being applied on an floating point type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateFloatingPoint

        protected static void validateFloatingPoint​(String opName,
                                                    String inputName,
                                                    SDVariable v)
        Validate that the operation is being applied on a floating point type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateBool

        protected static void validateBool​(String opName,
                                           SDVariable v)
        Validate that the operation is being applied on a boolean type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        v - Variable to validate datatype for (input to operation)
      • validateBool

        protected static void validateBool​(String opName,
                                           String inputName,
                                           SDVariable v)
        Validate that the operation is being applied on a boolean type SDVariable
        Parameters:
        opName - Operation name to print in the exception
        inputName - Name of the input to the op to validate
        v - Variable to validate datatype for (input to operation)
      • validateBool

        protected static void validateBool​(String opName,
                                           SDVariable v1,
                                           SDVariable v2)
        Validate that the operation is being applied on boolean SDVariables
        Parameters:
        opName - Operation name to print in the exception
        v1 - Variable to validate datatype for (input to operation)
        v2 - Variable to validate datatype for (input to operation)
      • validateSameType

        protected static void validateSameType​(String opName,
                                               boolean numericalOnly,
                                               SDVariable... vars)
        Validate that the operation is being applied on array with the exact same datatypes (which may optionally be restricted to numerical SDVariables only (not boolean or utf8))
        Parameters:
        opName - Operation name to print in the exception
        numericalOnly - If true, the variables must all be the same type, and must be numerical (not boolean/utf8)
        vars - Variable to perform operation on
      • isSameType

        public static boolean isSameType​(SDVariable[] x)