From de690d2ad2ca7e3e4007992f96db5f05b4b75bf4 Mon Sep 17 00:00:00 2001
From: Giovanni La Mura <giovanni.lamura@inaf.it>
Date: Mon, 11 Mar 2024 13:15:16 +0100
Subject: [PATCH] Always refer to np_int definition

---
 src/cluster/cluster.cpp      | 26 +++++++++++++-------------
 src/include/lapack_calls.h   |  4 ++--
 src/libnptm/lapack_calls.cpp |  4 ++--
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp
index e2debd90..1f2fb9be 100644
--- a/src/cluster/cluster.cpp
+++ b/src/cluster/cluster.cpp
@@ -13,6 +13,17 @@
 #include "../include/types.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_ERRORS_H_
 #include "../include/errors.h"
 #endif
@@ -37,17 +48,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 +86,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 +144,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/lapack_calls.h b/src/include/lapack_calls.h
index 6f2f365b..5165ceca 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/libnptm/lapack_calls.cpp b/src/libnptm/lapack_calls.cpp
index 0b1dac5a..363ba2af 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);
-- 
GitLab