From b756453d120808e961806d6cc3f42d919a234067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 29 May 2022 14:36:32 +0300 Subject: [PATCH 1/2] Forgotten header lattice_types.h --- qpms/lattices_types.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 qpms/lattices_types.h diff --git a/qpms/lattices_types.h b/qpms/lattices_types.h new file mode 100644 index 0000000..4254798 --- /dev/null +++ b/qpms/lattices_types.h @@ -0,0 +1,37 @@ +/*! \file lattices_types.h + * \brief Auxiliary lattice point generator and related enum declarations. + * + * This file contains necessary declarations needed in other header files. + * In contrast to lattices.h, this one is C++ compatible. + * + * \see lattices.h + */ +#ifndef LATTICES_TYPES_H +#define LATTICES_TYPES_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum LatticeDimensionality { + LAT1D = 1, + LAT2D = 2, + LAT3D = 4, + SPACE1D = 8, + SPACE2D = 16, + SPACE3D = 32, + LAT_1D_IN_3D = 33, + LAT_2D_IN_3D = 34, + LAT_3D_IN_3D = 40, + // special coordinate arrangements (indicating possible optimisations) + LAT_ZONLY = 64, + LAT_XYONLY = 128, + LAT_1D_IN_3D_ZONLY = 97, // LAT1D | SPACE3D | 64 + LAT_2D_IN_3D_XYONLY = 162 // LAT2D | SPACE3D | 128 +} LatticeDimensionality; + +struct PGen; + +#ifdef __cplusplus +} +#endif +#endif // LATTICES_TYPES_H From 165dbe3d615d1610fc8872ff6488f03fc709e994 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 2/2] 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); + } +}