try_inverse and ownership
- Dominant language
- Rust
- Stars
- 4.8k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I noticed in the [docs for `try_inverse_mut`](https://docs.rs/nalgebra/latest/nalgebra/base/struct.Matrix.html#method.try_inverse_mut):
> If you need to preserve the original matrix regardless of success or failure, consider using [Self::try_inverse](https://docs.rs/nalgebra/latest/nalgebra/base/struct.Matrix.html#method.try_inverse) instead.
But `try_inverse` takes `self`, not `&self`, and consumes the matrix. So, two points:
1. Should the docs be reworded? To me, the implication that `try_inverse` preserves the original matrix seems to be false. Or is something else meant by "preserved"?
2. Is there a possible performance optimization here, to make`try_inverse` not take ownership of the matrix, and thus allow the end-user to avoid `.clone()`? We still have to allocate memory for the LU decomposition, but we can at least save CPU cycles copying all the values, right?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.