Skip to content

Commit 52cc6f1

Browse files
committed
Fixed errors in Vector.random
1 parent 2727298 commit 52cc6f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cyaron/vector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def random(num: int = 5, position_range: list = None, mode: VectorRandomMode = 0
5454

5555
result = []
5656
if mode == VectorRandomMode.repeatable:
57-
result = [[random.randint(x, y) for x, y in zip(offset, length)] for _ in range(num)]
57+
result = [[random.randint(x, x + y) for x, y in zip(offset, length)] for _ in range(num)]
5858
elif mode == VectorRandomMode.float:
59-
result = [[random.uniform(x, y) for x, y in zip(offset, length)] for _ in range(num)]
59+
result = [[random.uniform(x, x + y) for x, y in zip(offset, length)] for _ in range(num)]
6060
elif mode == VectorRandomMode.unique and vector_space > 5 * num:
6161
# O(NlogN)
6262
num_set = set()

0 commit comments

Comments
 (0)