Skip to content

Instantly share code, notes, and snippets.

@iskandr
Created January 30, 2013 00:54
Show Gist options
  • Select an option

  • Save iskandr/4669615 to your computer and use it in GitHub Desktop.

Select an option

Save iskandr/4669615 to your computer and use it in GitHub Desktop.
def count_thresh(values :: array1(float64), thresh :: float64) => int64:
n :: int64 = 0 :: int64
shape_tuple :: tuple(int64) = values.shape
for i in range(0, shape_tuple[0], 1):
(header)
n_loop <- phi(0 :: int64, n2)
(body)
elt :: float64 = values[i]
less_tmp :: bool = elt < thresh
n2 :: int64 = n_loop + cast<int64>(less_tmp)
return n_loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment