| #include "../../Eigen/Core" |
| |
| extern "C" { |
| void clacgv_(int *n, std::complex<float> *x, int *incx); |
| void zlacgv_(int *n, std::complex<double> *x, int *incx); |
| } |
| |
| using Eigen::Map; |
| using Eigen::Matrix; |
| using Eigen::Dynamic; |
| using Eigen::InnerStride; |
| |
| // Conjugate the entries of the vector x. |
| template <typename T> |
| void xlacgv(const int n, T *x, const int incx) { |
| using StridedVector = Map<Matrix<T, Dynamic, 1>, 0, InnerStride<Dynamic>>; |
| StridedVector xvec(x, n, InnerStride<Dynamic>(std::abs(incx))); |
| xvec = xvec.conjugate(); |
| } |
| |
| void clacgv_(int *n, std::complex<float> *x, int *incx) { |
| xlacgv(*n, x, *incx); |
| } |
| |
| void zlacgv_(int *n, std::complex<double> *x, int *incx) { |
| xlacgv(*n, x, *incx); |
| } |