<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
lahqz_eig22.hpp
Go to the documentation of this file.
1
3//
4// Copyright (c) 2013-2022, University of Colorado Denver. All rights reserved.
5//
6// This file is part of <T>LAPACK.
7// <T>LAPACK is free software: you can redistribute it and/or modify it under
8// the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
9
10#ifndef __TLAPACK_LAHQZ_EIG22_HH__
11#define __TLAPACK_LAHQZ_EIG22_HH__
12
15
16namespace tlapack {
17
34template <TLAPACK_MATRIX A_t, TLAPACK_MATRIX B_t, TLAPACK_SCALAR T>
35void lahqz_eig22(const A_t& A,
36 const B_t& B,
39 T& beta1,
40 T& beta2)
41{
42 // Calculate X = AB^{-1}
43 auto x00 = A(0, 0) / B(0, 0);
44 auto x01 = A(0, 1) / B(1, 1);
45 auto x10 = A(1, 0) / B(0, 0);
46 auto x11 = A(1, 1) / B(1, 1);
47 auto u01 = B(0, 1) / B(1, 1);
48 x01 = x01 - u01 * x00;
49 x11 = x11 - u01 * x10;
50
51 // Calculate eigenvalues of X
52 beta1 = (T)1.;
53 beta2 = (T)1.;
55}
56
57} // namespace tlapack
58
59#endif // __LAHQZ_EIG22_HH__
void lahqr_eig22(T a00, T a01, T a10, T a11, complex_type< T > &s1, complex_type< T > &s2)
Computes the eigenvalues of a 2x2 matrix A.
Definition lahqr_eig22.hpp:34
void lahqz_eig22(const A_t &A, const B_t &B, complex_type< T > &alpha1, complex_type< T > &alpha2, T &beta1, T &beta2)
Computes the generalized eigenvalues of a 2x2 pencil (A,B) with B upper triangular.
Definition lahqz_eig22.hpp:35
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113