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

Implemented AddAssign, SubAssign and MulAssign traits for Matrix. #20

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

Mickanos
Copy link
Contributor

This pull request implements the traits AddAssign, SubAssign and MulAssign for the Matrix type. Addition and substraction make advantage of the add_assign and sub_assign methods for rings, while mul_assign simply reuses the mul method of Matrix and is only added for completeness.

@Mickanos Mickanos marked this pull request as ready for review August 21, 2024 06:23
@@ -804,6 +844,11 @@ mod test {
assert_eq!(&c[1], &[139, 154]);
assert_eq!(c[(0, 1)], 64);

let mut d = a.clone();
d+= &a;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run the auto-formatter (probably good to do it on-save)?

@Mickanos
Copy link
Contributor Author

Mickanos commented Aug 21, 2024

I realize I did not add the new methods to the Python API. I should probably do that.
Edit: Actually, these methods are not really relevant to the Python API, are they?

@benruijl
Copy link
Owner

The are relevant, but I realize I haven't overloaded any other assignment operator yet, so I can also do that in bulk later for every type.

@benruijl benruijl merged commit bd0536c into benruijl:main Aug 21, 2024
1 of 2 checks passed
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.

2 participants