Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed errors in Vector.random when generating floating-point vectors or vectors with repeated elements. #141

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

weilycoder
Copy link
Contributor

@weilycoder weilycoder commented Oct 5, 2024

#140

没写 Test 导致的,但是好像也不太好写。

EDITED: 加入了 vector_test

@weilycoder
Copy link
Contributor Author

另外,可以将 unique 部分的代码简单写成:

[tuple(map(lambda x, y: x + y, Vector.get_vector(dimension, length, x), offset)) for x in random.sample(range(vector_space), k=num)]

可以优化时空间效率。

暂时未作修改。

@Mr-Python-in-China
Copy link
Collaborator

我草前一版谁写的
出列

@Mr-Python-in-China Mr-Python-in-China merged commit 3b8fba8 into luogu-dev:master Oct 5, 2024
2 checks passed
@weilycoder weilycoder deleted the dev2 branch October 5, 2024 05:35
@Mr-Python-in-China Mr-Python-in-China linked an issue Oct 19, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

貌似是一个 bug?
2 participants