From 3d31f322517a0092398559a05dd7f978b1bad77b Mon Sep 17 00:00:00 2001 From: Maxim Zhiburt Date: Tue, 19 Jul 2022 15:19:36 +0300 Subject: [PATCH 1/2] update try_inverse doc comment --- src/linalg/inverse.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/linalg/inverse.rs b/src/linalg/inverse.rs index f07be14a..ad6f96b4 100644 --- a/src/linalg/inverse.rs +++ b/src/linalg/inverse.rs @@ -9,6 +9,10 @@ use crate::linalg::lu; impl> SquareMatrix { /// Attempts to invert this matrix. + /// + /// # Panics + /// + /// It's unable to invert a non-square matrix so it panics in such case. #[inline] #[must_use = "Did you mean to use try_inverse_mut()?"] pub fn try_inverse(self) -> Option> @@ -27,6 +31,10 @@ impl> SquareMatrix { impl> SquareMatrix { /// Attempts to invert this matrix in-place. Returns `false` and leaves `self` untouched if /// inversion fails. + /// + /// # Panics + /// + /// It's unable to invert a non-square matrix so it panics in such case. #[inline] pub fn try_inverse_mut(&mut self) -> bool where From 5ed215932caeba51fed15af1e4e7daa425a00092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 14 Jan 2023 12:02:37 +0100 Subject: [PATCH 2/2] Slightly change comment wording. --- src/linalg/inverse.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/linalg/inverse.rs b/src/linalg/inverse.rs index ad6f96b4..91d45587 100644 --- a/src/linalg/inverse.rs +++ b/src/linalg/inverse.rs @@ -8,11 +8,11 @@ use crate::base::{DefaultAllocator, OMatrix, SquareMatrix}; use crate::linalg::lu; impl> SquareMatrix { - /// Attempts to invert this matrix. - /// + /// Attempts to invert this square matrix. + /// /// # Panics - /// - /// It's unable to invert a non-square matrix so it panics in such case. + /// + /// Panics if `self` isn’t a square matrix. #[inline] #[must_use = "Did you mean to use try_inverse_mut()?"] pub fn try_inverse(self) -> Option> @@ -29,12 +29,12 @@ impl> SquareMatrix { } impl> SquareMatrix { - /// 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 - /// - /// It's unable to invert a non-square matrix so it panics in such case. + /// + /// Panics if `self` isn’t a square matrix. #[inline] pub fn try_inverse_mut(&mut self) -> bool where