Commit 7f0d7766 authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

provide flag for starting indices at zero

parent e3b89c85
......@@ -2,7 +2,7 @@ import numpy as np
from .distance import weierstrass_distance
# wrapper to provide a nicer interface
def find(tiling, nn_dist=None, which="optimized_slice", verbose=False):
def find(tiling, nn_dist=None, which="optimized_slice", index_from_zero=True, verbose=False):
if nn_dist == None:
if verbose:
......@@ -21,6 +21,16 @@ def find(tiling, nn_dist=None, which="optimized_slice", verbose=False):
print("[Hypertiling] Error:", which, " is not a valid algorithm!")
nbrs = []
if index_from_zero:
for sublist in retval:
new_sublist = [x-1 for x in sublist]
nbrs.append(new_sublist)
return nbrs
else:
return retval
# find nearest neighbours by brute force comparison of all-to-all distances
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment