sarah-ek / faer-rs

Linear algebra foundation for the Rust programming language
https://faer-rs.github.io
MIT License
1.79k stars 58 forks source link

`MulAssign<E: Entity>` #47

Closed DJDuque closed 1 year ago

DJDuque commented 1 year ago

Is your feature request related to a problem? Please describe. I have a x: Mat<f64> and an n: f64and I need to update x = n * x.

Describe the solution you'd like I think it would be convenient to implement the MulAssign trait such that we can do x *= n and it reuses the memory allocated for x.

Describe alternatives you've considered Maybe it would be good to have a generic map_with method that transforms all the elements of a matrix in place. It could be used to implement this MulAssign trait, and it would probably be useful for other things as well.

DJDuque commented 1 year ago

Closed with PR https://github.com/sarah-ek/faer-rs/pull/49