Merge pull request #1129 from zhiburt/try_inverse_comment

update try_inverse doc comment
This commit is contained in:
Sébastien Crozet 2023-01-14 12:03:12 +01:00 committed by GitHub
commit 9a3bebc5c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -8,7 +8,11 @@ use crate::base::{DefaultAllocator, OMatrix, SquareMatrix};
use crate::linalg::lu;
impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> SquareMatrix<T, D, S> {
/// Attempts to invert this matrix.
/// Attempts to invert this square matrix.
///
/// # Panics
///
/// Panics if `self` isnt a square matrix.
#[inline]
#[must_use = "Did you mean to use try_inverse_mut()?"]
pub fn try_inverse(self) -> Option<OMatrix<T, D, D>>
@ -25,8 +29,12 @@ impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> SquareMatrix<T, D, S> {
}
impl<T: ComplexField, D: Dim, S: StorageMut<T, D, D>> SquareMatrix<T, D, S> {
/// Attempts to invert this matrix in-place. Returns `false` and leaves `self` untouched if
/// Attempts to invert this square matrix in-place. Returns `false` and leaves `self` untouched if
/// inversion fails.
///
/// # Panics
///
/// Panics if `self` isnt a square matrix.
#[inline]
pub fn try_inverse_mut(&mut self) -> bool
where