From 8a2d4a2969da0d8dbfb24e489262368f9461c781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 29 May 2022 14:25:42 +0300 Subject: [PATCH] Forgotten source catch_aux.C --- tests/catch/catch_aux.C | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/catch/catch_aux.C diff --git a/tests/catch/catch_aux.C b/tests/catch/catch_aux.C new file mode 100644 index 0000000..4168c18 --- /dev/null +++ b/tests/catch/catch_aux.C @@ -0,0 +1,24 @@ +#include "catch_aux.h" +#include "complex.h" +namespace qpmstest{ + /// Creates a new vector from complex number array + std::vector pointer2dvec(const _Complex double *arr, size_t siz){ + std::vector vec(2*siz); + for(size_t i = 0; i < siz; ++i) { + vec[2*i] = creal(arr[i]); + vec[2*i+1] = cimag(arr[i]); + } + return vec; + } + + std::vector pointer2dvec(const double *arr, size_t siz){ + std::vector vec(siz); + for(size_t i = 0; i < siz; ++i) + vec[i] = arr[i]; + return vec; + } + + std::vector pointer2dvec(const csphvec_t *arr, size_t siz) { + return pointer2dvec(&arr->rc, 3*siz); + } +}