-
Notifications
You must be signed in to change notification settings - Fork 0
return Matrix in case somebody private function modifies Matrix this way #62
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
base: git2025
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,16 @@ def matrices_almost_equal(actual, expected, eps=1e-6): | |
|
|
||
| def a(a, b, c, d): | ||
| if not (0 <= b < len(a)) or not (0 <= c < len(a)) or d == 0: | ||
| return | ||
| return a | ||
| a[c] = [x + d * y for x, y in zip(a[c], a[b])] | ||
| return a | ||
|
Comment on lines
22
to
+26
|
||
|
|
||
|
|
||
| def m(a, b, c): | ||
|
||
| if not (0 <= b < len(a)) or c == 0: | ||
| return | ||
| return a | ||
| a[b] = [x * c if x != 0 else x for x in a[b]] | ||
| return a | ||
|
Comment on lines
29
to
+33
|
||
|
|
||
|
|
||
| @check50.check() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter name
ashadows the function namea, which reduces code clarity. Additionally, using single-letter parameter names makes the code harder to understand. Consider renaming the parameters to be more descriptive, such asmatrix,source_row_idx,target_row_idx, andscalar.