/* * File: Vector.hpp * Author: jens * * Created on 19. Dezember 2014, 18:24 */ #ifndef _RADIO_VECTOR_HPP_ #define _RADIO_VECTOR_HPP_ #include using namespace Eigen; #include using namespace std; #include using Eigen::Dense; #ifndef radio_float_t #define radio_float_t float #endif namespace Radio { typedef radio_float_t RealScalar; typedef complex ComplexScalar; typedef Matrix RVec; typedef Matrix CVec; typedef Matrix RMat; typedef Matrix CMat; static ComplexScalar toComplexScalar(cpx_t v) { return ComplexScalar(v.real, v.imag); } static cpx_t toCpx(ComplexScalar v) { return Cpx(v.real(), v.imag()); } static void toComplexVector(CVec &dst, cpx_t const *pSrc, uint32_t len) { for (uint32_t i=0; i < len; i++) { dst[i] = ComplexScalar(pSrc[i].real, pSrc[i].imag); } } static void toCpxVector(cpx_t *pDst, CVec const &src, uint32_t len) { for (uint32_t i=0; i < len; i++) { pDst[i].real = src[i].real(); pDst[i].imag = src[i].imag(); } } } // ::Radio #endif /* _RADIO_VECTOR_HPP_ */