Skip to content

Instantly share code, notes, and snippets.

@lan496
Created March 28, 2019 03:42
Show Gist options
  • Select an option

  • Save lan496/ec5b7cda5cdfb4a87331612d7633fa16 to your computer and use it in GitHub Desktop.

Select an option

Save lan496/ec5b7cda5cdfb4a87331612d7633fa16 to your computer and use it in GitHub Desktop.
from itertools import product
import numpy as np
def enumerate_ANX(oxi_states, max_ratio=8):
ret = []
for anx in product(range(1, max_ratio + 1), repeat=len(oxi_states)):
if np.sum(np.array(oxi_states) * np.array(anx)) == 0:
ret.append(anx)
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment