11#ifndef TLAPACK_BLAS_ROTG_HH
12#define TLAPACK_BLAS_ROTG_HH
37 enable_if_t<is_real<T>,
int> = 0,
38 disable_if_allow_optblas_t<T> = 0>
50 const T
anorm = abs(a);
104 enable_if_t<is_complex<T>,
int> = 0,
105 disable_if_allow_optblas_t<T> = 0>
157 : sqrt(
f2) * sqrt(
h2);
188 : sqrt(
f2) * sqrt(
h2);
197#ifdef TLAPACK_USE_LAPACKPP
200 enable_if_t<is_real<T>,
int> = 0,
201 enable_if_allow_optblas_t<T> = 0>
202void rotg(T& a, T& b, T& c, T& s)
207 const T anorm = abs(a);
208 const T bnorm = abs(b);
211 ::lapack::lartg(a, b, &c, &s, &r);
215 if (s == zero || c == zero || (anorm > bnorm))
224 enable_if_t<is_complex<T>,
int> = 0,
225 enable_if_allow_optblas_t<T> = 0>
226void rotg(T& a,
const T& b, real_type<T>& c, T& s)
229 ::lapack::lartg(a, b, &c, &s, &r);
constexpr real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
constexpr real_type< T > imag(const T &x) noexcept
Extends std::imag() to real datatypes.
Definition utils.hpp:86
constexpr int sgn(const T &val)
Type-safe sgn function.
Definition utils.hpp:109
#define TLAPACK_COMPLEX
Macro for tlapack::concepts::Complex compatible with C++17.
Definition concepts.hpp:921
#define TLAPACK_REAL
Macro for tlapack::concepts::Real compatible with C++17.
Definition concepts.hpp:918
void rotg(T &a, T &b, T &c, T &s)
Construct plane rotation that eliminates b, such that:
Definition rotg.hpp:39
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