From 2c544f057687e87cb3e73562470caa27afae65e9 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Mon, 22 Dec 2014 17:37:43 +0000 Subject: [PATCH] - added some helpers git-svn-id: http://moon:8086/svn/software/trunk/libsrc/cpp@107 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- radio/Vector.hpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/radio/Vector.hpp b/radio/Vector.hpp index a8d270b..59edb51 100644 --- a/radio/Vector.hpp +++ b/radio/Vector.hpp @@ -9,10 +9,15 @@ #define VECTOR_HPP #include -#include "../radio/radio_types.h" -using namespace std; using namespace Eigen; +#include +using namespace std; + +#include "../radio/radio_types.h" + +using Eigen::Dense; + #ifndef radio_float_t #define radio_float_t float #endif @@ -39,6 +44,23 @@ 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 /* VECTOR_HPP */