forked from M-Labs/nalgebra
GivensRotation::new() should default to (I, 0)
This commit is contained in:
parent
da23386beb
commit
a62d9d1ad1
@ -38,7 +38,8 @@ impl<N: ComplexField> GivensRotation<N> {
|
|||||||
|
|
||||||
/// Initializes a Givens rotation from its non-normalized cosine an sine components.
|
/// Initializes a Givens rotation from its non-normalized cosine an sine components.
|
||||||
pub fn new(c: N, s: N) -> (Self, N) {
|
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.
|
/// Initializes a Givens rotation form its non-normalized cosine an sine components.
|
||||||
|
Loading…
Reference in New Issue
Block a user