diff --git a/src/linalg/givens.rs b/src/linalg/givens.rs index ed93a83c..20e2c309 100644 --- a/src/linalg/givens.rs +++ b/src/linalg/givens.rs @@ -38,7 +38,8 @@ impl GivensRotation { /// Initializes a Givens rotation from its non-normalized cosine an sine components. pub fn new(c: N, s: N) -> (Self, N) { - Self::try_new(c, s, N::RealField::zero()).unwrap() + Self::try_new(c, s, N::RealField::zero()) + .unwrap_or_else(|| (GivensRotation::identity(), N::zero())) } /// Initializes a Givens rotation form its non-normalized cosine an sine components.