From a62d9d1ad1f4b261871081c92bdd53f84e43c703 Mon Sep 17 00:00:00 2001 From: Ilya Epifanov Date: Wed, 5 Feb 2020 14:24:27 +0100 Subject: [PATCH] GivensRotation::new() should default to (I, 0) --- src/linalg/givens.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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.