sarah-ek / faer-rs

Linear algebra foundation for the Rust programming language

Home Page:https://faer-rs.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`AddAssign` and `SubAssign` traits

DJDuque opened this issue · comments

Is your feature request related to a problem? Please describe.
I have a x: Mat<f64> and y: MatRef<'_, f64> and I need to update x = x - y.

Describe the solution you'd like
I think it would be convenient to have an impl SubAssign<Rhs = MatRef> for Mat such that it reuses the memory allocated for x.

Describe alternatives you've considered
I am currently solving my issue with Mat::with_dims to create a new matrix. Implementing these traits could be a bit more performant, and it would definitely be more readable.

done!