def impl(x): if len(x) <= 0: printf("omnisci_array_min: cannot find min of zero-sized array" ) # noqa: E501 return max_value m = x[0] for i in range(len(x)): v = x[i] if v < m: m = v return m
def array_return(size): printf("entering array_return(%i)\n", size) a = Array(size, types.float64) b = Array(size, types.float64) for i in range(size): a[i] = float(i) b[i] = float(size - i - 1) if size % 2: c = a else: c = b printf("returning array with length %i\n", len(c)) return c
def impl(x, initial=None): if len(x) <= 0: printf("omnisci_array_min: cannot find min of zero-sized array" ) # noqa: E501 return max_value if initial is not None: m = initial else: m = x[0] for i in range(len(x)): v = x[i] if v < m: m = v return m
def impl(x): if len(x) == 0: printf("Mean of empty array") return zero_value return sum(x) / len(x)