Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
xrange -> range (for Python3)
  • Loading branch information
Leonid Boytsov authored and Leonid Boytsov committed Apr 13, 2019
1 parent 83c2775 commit 658214d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
35 changes: 0 additions & 35 deletions data/genhist_nonunif.py

This file was deleted.

4 changes: 2 additions & 2 deletions data/genhist_unif.py
Expand Up @@ -28,10 +28,10 @@ dim = args['dim']
minVal=args['min_val']

f=open(outf, 'w')
for i in xrange(nd):
for i in range(nd):
# See an explanation from this blog post http://blog.geomblog.org/2005/10/sampling-from-simplex.html
# There's more on sampling from the simplex: Luc Devroye's book, 'Non-Uniform Random Variate Generation'.
arr = numpy.array([-math.log(random.random()) for _ in xrange(dim)])
arr = numpy.array([-math.log(random.random()) for _ in range(dim)])
arr /= sum(arr)
f.write("\t".join([("%g" % max(v,minVal)) for v in arr]) + "\n")
f.close()
Expand Down

0 comments on commit 658214d

Please sign in to comment.