hint for future improvement

This commit is contained in:
Martin Diehl 2020-11-01 19:20:52 +01:00
parent a325d1bf00
commit cf18954db9
1 changed files with 1 additions and 0 deletions

View File

@ -169,6 +169,7 @@ def scale_to_coprime(v):
def lcm(a, b):
"""Least common multiple."""
# Python 3.9 provides math.lcm, see https://stackoverflow.com/questions/51716916.
return a * b // np.gcd(a, b)
m = (np.array(v) * reduce(lcm, map(lambda x: int(get_square_denominator(x)),v)) ** 0.5).astype(np.int)