diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index e2debd9055ca0faf7a9711f360a7bd7d8f5637bd..7d41b25e7d0b9e40b48e25818d6ff9b982616213 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -37,17 +37,6 @@ #include "../include/TransitionMatrix.h" #endif -#ifdef USE_LAPACK -#ifdef USE_MKL -#include <mkl_lapacke.h> -#else -#include <lapacke.h> -#endif -#ifndef INCLUDE_LAPACK_CALLS_H_ -#include "../include/lapack_calls.h" -#endif -#endif - #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" #endif @@ -86,7 +75,7 @@ void cluster(string config_file, string data_file, string output_path) { if (sconf->number_of_spheres == gconf->number_of_spheres) { // Shortcuts to variables stored in configuration objects int nsph = gconf->number_of_spheres; - lapack_int mxndm = (lapack_int)gconf->mxndm; + np_int mxndm = (np_int)gconf->mxndm; int inpol = gconf->in_pol; int npnt = gconf->npnt; int npntts = gconf->npntts; @@ -144,7 +133,7 @@ void cluster(string config_file, string data_file, string output_path) { if (sconf->iog_vec[ci -1] >= ci) configurations++; } C2 *c2 = new C2(nsph, configurations, npnt, npntts); - lapack_int ndit = 2 * nsph * c4->nlim; + np_int ndit = 2 * nsph * c4->nlim; dcomplex *am_vector = new dcomplex[ndit * ndit](); dcomplex **am = new dcomplex*[ndit]; for (int ai = 0; ai < ndit; ai++) { diff --git a/src/include/algebraic.h b/src/include/algebraic.h index 01437ac9d3f21d49610ae6921421e5933ebefc42..efd13cf77de5c430060b1f0c248f637839983150 100644 --- a/src/include/algebraic.h +++ b/src/include/algebraic.h @@ -12,23 +12,9 @@ * legacy serial function implementation is used as a fall-back. */ -#ifdef USE_LAPACK -#ifdef USE_MKL -#include <mkl_lapacke.h> -#else -#include <lapacke.h> -#endif -#else -#define lapack_int int64_t -#endif - #ifndef INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ -#ifndef np_int -#define np_int lapack_int -#endif - /*! \brief Perform in-place matrix inversion. * * \param mat: `complex double **` The matrix to be inverted (must be a square matrix). diff --git a/src/include/clu_subs.h b/src/include/clu_subs.h index 6852a46906998e878b0021dc5d606ac8500e8322..2e57fa71c3a55c7cffbd68a68b7bec5ccaa15b8e 100644 --- a/src/include/clu_subs.h +++ b/src/include/clu_subs.h @@ -17,14 +17,6 @@ #ifndef INCLUDE_CLU_SUBS_H_ #define INCLUDE_CLU_SUBS_H_ -#ifndef np_int -#ifndef lapack_int -#define np_int int64_t -#else -#define np_int lapack_int -#endif -#endif - /*! \brief Compute the asymmetry-corrected scattering cross-section of a cluster. * * This function computes the product between the geometrical asymmetry parameter and diff --git a/src/include/lapack_calls.h b/src/include/lapack_calls.h index 6f2f365bbc027bf2c4037ccbc2dcbe33403874bf..5165ceca0df53c4b29bcf0441557a27ce6a512be 100644 --- a/src/include/lapack_calls.h +++ b/src/include/lapack_calls.h @@ -15,9 +15,9 @@ * matrix with double precision elements. * * \param mat: Matrix of complex. The matrix to be inverted. - * \param n: `lapack_int` The number of rows and columns of the [n x n] matrix. + * \param n: `np_int` The number of rows and columns of the [n x n] matrix. * \param jer: `int &` Reference to an integer return flag. */ -void zinvert(dcomplex **mat, lapack_int n, int &jer); +void zinvert(dcomplex **mat, np_int n, int &jer); #endif diff --git a/src/include/types.h b/src/include/types.h index 0271769a73600adc8de3ff6dfe1cf4d9d0f8a49f..6eda961a429ebaa1a149ebb700cdea2d5ef69e4e 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -12,6 +12,22 @@ typedef __complex__ double dcomplex; +#ifdef USE_LAPACK +#ifdef USE_MKL +#include <mkl_lapacke.h> +#else +#include <lapacke.h> +#endif +#endif + +#ifndef np_int +#ifdef lapack_int +#define np_int lapack_int +#else +#define np_int int64_t +#endif +#endif + /*! \brief Get the real part of a complex number. * * \param z: `complex double` The argument of the function. diff --git a/src/libnptm/algebraic.cpp b/src/libnptm/algebraic.cpp index 48335792275ba7097b29f5b639fe828bbd1aa8d2..8811abca884727176dc5c76439004ddc1b27f69e 100644 --- a/src/libnptm/algebraic.cpp +++ b/src/libnptm/algebraic.cpp @@ -9,11 +9,6 @@ #endif #ifdef USE_LAPACK -#ifdef USE_MKL -#include <mkl_lapacke.h> -#else -#include <lapacke.h> -#endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "../include/lapack_calls.h" #endif diff --git a/src/libnptm/lapack_calls.cpp b/src/libnptm/lapack_calls.cpp index 0b1dac5ac92ec6e876a560c0ab239e49a77314c2..363ba2afca48486f1799b394506401c267294f24 100644 --- a/src/libnptm/lapack_calls.cpp +++ b/src/libnptm/lapack_calls.cpp @@ -21,7 +21,7 @@ #endif #ifdef USE_LAPACK -void zinvert(dcomplex **mat, lapack_int n, int &jer) { +void zinvert(dcomplex **mat, np_int n, int &jer) { jer = 0; dcomplex *arr = &(mat[0][0]); const dcomplex uim = 0.0 + 1.0 * I; @@ -30,7 +30,7 @@ void zinvert(dcomplex **mat, lapack_int n, int &jer) { MKL_Complex16 *arr2 = (MKL_Complex16 *) arr; #endif - lapack_int* IPIV = new lapack_int[n](); + np_int* IPIV = new np_int[n](); #ifdef USE_MKL LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr2, n, IPIV);