def __register_random_uniform_function(cls):
     """
     Registers the random method as used to generate a random sample from a uniform distribution in the interval [offset, offset + scale).
     """
     symbol = FunctionSymbol(name=cls.RANDOM_UNIFORM, param_types=[PredefinedTypes.get_template_type(0), PredefinedTypes.get_template_type(0)],
                             return_type=PredefinedTypes.get_template_type(0),
                             element_reference=None, is_predefined=True)
     cls.name2function[cls.RANDOM_UNIFORM] = symbol
 def __register_random_normal_function(cls):
     """
     Registers the random method as used to generate a random normal (Gaussian) distributed variable with first parameter "mean" and second parameter "standard deviation".
     """
     symbol = FunctionSymbol(name=cls.RANDOM_NORMAL, param_types=[PredefinedTypes.get_template_type(0), PredefinedTypes.get_template_type(0)],
                             return_type=PredefinedTypes.get_template_type(0),
                             element_reference=None, is_predefined=True)
     cls.name2function[cls.RANDOM_NORMAL] = symbol
 def __register_abs_function(cls):
     """
     Registers the absolute value function.
     """
     params = list()
     params.append(PredefinedTypes.get_template_type(0))
     symbol = FunctionSymbol(name=cls.ABS, param_types=params,
                             return_type=PredefinedTypes.get_template_type(0),
                             element_reference=None, is_predefined=True)
     cls.name2function[cls.ABS] = symbol
 def __register_min_function(cls):
     """
     Registers the minimum function.
     """
     params = list()
     params.append(PredefinedTypes.get_template_type(0))
     params.append(PredefinedTypes.get_template_type(0))
     symbol = FunctionSymbol(name=cls.MIN, param_types=params,
                             return_type=PredefinedTypes.get_template_type(0),
                             element_reference=None, is_predefined=True)
     cls.name2function[cls.MIN] = symbol
    def __register_clip_function(cls):
        """
        Registers the clip function (bound a number between a minimum and a
        maximum value).
        """
        params = list()

        params.append(PredefinedTypes.get_template_type(0))  # value
        params.append(PredefinedTypes.get_template_type(0))  # min
        params.append(PredefinedTypes.get_template_type(0))  # max

        symbol = FunctionSymbol(name=cls.CLIP, param_types=params,
                                return_type=PredefinedTypes.get_template_type(0),
                                element_reference=None, is_predefined=True)
        cls.name2function[cls.CLIP] = symbol