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 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); + } +}