update try_inverse doc comment

This commit is contained in:
Maxim Zhiburt 2022-07-19 15:19:36 +03:00 committed by Sébastien Crozet
parent dc1b291ece
commit 3d31f32251
1 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,10 @@ use crate::linalg::lu;
impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> SquareMatrix<T, D, S> { impl<T: ComplexField, D: Dim, S: Storage<T, D, D>> SquareMatrix<T, D, S> {
/// Attempts to invert this matrix. /// Attempts to invert this matrix.
///
/// # Panics
///
/// It's unable to invert a non-square matrix so it panics in such case.
#[inline] #[inline]
#[must_use = "Did you mean to use try_inverse_mut()?"] #[must_use = "Did you mean to use try_inverse_mut()?"]
pub fn try_inverse(self) -> Option<OMatrix<T, D, D>> pub fn try_inverse(self) -> Option<OMatrix<T, D, D>>
@ -27,6 +31,10 @@ 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> { 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 matrix in-place. Returns `false` and leaves `self` untouched if
/// inversion fails. /// inversion fails.
///
/// # Panics
///
/// It's unable to invert a non-square matrix so it panics in such case.
#[inline] #[inline]
pub fn try_inverse_mut(&mut self) -> bool pub fn try_inverse_mut(&mut self) -> bool
where where