Loading src/cluster/cluster.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -282,9 +282,9 @@ void cluster(string config_file, string data_file, string output_path) { tppoan.open(tppoan_name.c_str(), ios::out | ios::binary); tppoan.open(tppoan_name.c_str(), ios::out | ios::binary); if (tppoan.is_open()) { if (tppoan.is_open()) { #ifdef USE_LAPACK #ifdef USE_LAPACK printf("INFO: should use LAPACK calls.\n"); printf("INFO: using LAPACK calls.\n"); #else #else printf("INFO: should use fall-back lucin() calls.\n"); printf("INFO: using fall-back lucin() calls.\n"); #endif #endif tppoan.write(reinterpret_cast<char *>(&iavm), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&iavm), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&isam), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&isam), sizeof(int)); Loading src/include/algebraic.h +9 −5 Original line number Original line Diff line number Diff line Loading @@ -10,13 +10,17 @@ * legacy serial function implementation is used as a fall-back. * legacy serial function implementation is used as a fall-back. */ */ #ifndef lapack_int #define lapack_int int64_t #endif #ifndef INCLUDE_ALGEBRAIC_H_ #ifndef INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #ifndef np_int #ifndef lapack_int #define np_int int64_t #else #define np_int lapack_int #endif #endif /*! \brief Perform in-place matrix inversion. /*! \brief Perform in-place matrix inversion. * * * \param mat: Matrix of complex. The matrix to be inverted (must be a square matrix). * \param mat: Matrix of complex. The matrix to be inverted (must be a square matrix). Loading @@ -25,6 +29,6 @@ * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * optional, defaults to 0). * optional, defaults to 0). */ */ void invert_matrix(std::complex<double> **mat, lapack_int size, int &ier, lapack_int max_size=0); void invert_matrix(std::complex<double> **mat, np_int size, int &ier, np_int max_size=0); #endif #endif src/include/clu_subs.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,14 @@ #ifndef INCLUDE_CLU_SUBS_H_ #ifndef INCLUDE_CLU_SUBS_H_ #define 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. /*! \brief Compute the asymmetry-corrected scattering cross-section of a cluster. * * * This function computes the product between the geometrical asymmetry parameter and * This function computes the product between the geometrical asymmetry parameter and Loading Loading @@ -158,7 +166,7 @@ void hjv( * \param n: `int64_t` * \param n: `int64_t` * \param ier: `int &` * \param ier: `int &` */ */ void lucin(std::complex<double> **am, const int64_t nddmst, int64_t n, int &ier); void lucin(std::complex<double> **am, const np_int nddmst, np_int n, int &ier); /*! \brief Compute the average extinction cross-section. /*! \brief Compute the average extinction cross-section. * * Loading src/libnptm/algebraic.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -5,26 +5,26 @@ #include <complex> #include <complex> #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "lapacke.h" #include "../include/lapack_calls.h" #include "../include/lapack_calls.h" #endif #endif #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" #endif // >>> FALL-BACK FUNCTIONS DECLARATION <<< // // >>> FALL-BACK FUNCTIONS DECLARATION <<< // extern void lucin(std::complex<double> **mat, int64_t max_size, int64_t size, int &ier); extern void lucin(std::complex<double> **mat, np_int max_size, np_int size, int &ier); // >>> END OF FALL-BACK FUNCTIONS <<< // // >>> END OF FALL-BACK FUNCTIONS <<< // using namespace std; using namespace std; void invert_matrix(std::complex<double> **mat, lapack_int size, int &ier, lapack_int max_size) { void invert_matrix(std::complex<double> **mat, np_int size, int &ier, np_int max_size) { ier = 0; ier = 0; #ifdef USE_LAPACK #ifdef USE_LAPACK zinvert(mat, size, ier); zinvert(mat, size, ier); #else #else lucin(mat, (int64_t)max_size, (int64_t)size, ier); lucin(mat, max_size, size, ier); #endif #endif } } src/libnptm/clu_subs.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -892,7 +892,7 @@ void hjv( delete[] rfn; delete[] rfn; } } void lucin(std::complex<double> **am, const int64_t nddmst, int64_t n, int &ier) { void lucin(std::complex<double> **am, const np_int nddmst, np_int n, int &ier) { /* NDDMST FIRST DIMENSION OF AM AS DECLARED IN DIMENSION /* NDDMST FIRST DIMENSION OF AM AS DECLARED IN DIMENSION * STATEMENT. * STATEMENT. * N NUMBER OF ROWS IN AM. * N NUMBER OF ROWS IN AM. Loading Loading
src/cluster/cluster.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -282,9 +282,9 @@ void cluster(string config_file, string data_file, string output_path) { tppoan.open(tppoan_name.c_str(), ios::out | ios::binary); tppoan.open(tppoan_name.c_str(), ios::out | ios::binary); if (tppoan.is_open()) { if (tppoan.is_open()) { #ifdef USE_LAPACK #ifdef USE_LAPACK printf("INFO: should use LAPACK calls.\n"); printf("INFO: using LAPACK calls.\n"); #else #else printf("INFO: should use fall-back lucin() calls.\n"); printf("INFO: using fall-back lucin() calls.\n"); #endif #endif tppoan.write(reinterpret_cast<char *>(&iavm), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&iavm), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&isam), sizeof(int)); tppoan.write(reinterpret_cast<char *>(&isam), sizeof(int)); Loading
src/include/algebraic.h +9 −5 Original line number Original line Diff line number Diff line Loading @@ -10,13 +10,17 @@ * legacy serial function implementation is used as a fall-back. * legacy serial function implementation is used as a fall-back. */ */ #ifndef lapack_int #define lapack_int int64_t #endif #ifndef INCLUDE_ALGEBRAIC_H_ #ifndef INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #ifndef np_int #ifndef lapack_int #define np_int int64_t #else #define np_int lapack_int #endif #endif /*! \brief Perform in-place matrix inversion. /*! \brief Perform in-place matrix inversion. * * * \param mat: Matrix of complex. The matrix to be inverted (must be a square matrix). * \param mat: Matrix of complex. The matrix to be inverted (must be a square matrix). Loading @@ -25,6 +29,6 @@ * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * optional, defaults to 0). * optional, defaults to 0). */ */ void invert_matrix(std::complex<double> **mat, lapack_int size, int &ier, lapack_int max_size=0); void invert_matrix(std::complex<double> **mat, np_int size, int &ier, np_int max_size=0); #endif #endif
src/include/clu_subs.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,14 @@ #ifndef INCLUDE_CLU_SUBS_H_ #ifndef INCLUDE_CLU_SUBS_H_ #define 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. /*! \brief Compute the asymmetry-corrected scattering cross-section of a cluster. * * * This function computes the product between the geometrical asymmetry parameter and * This function computes the product between the geometrical asymmetry parameter and Loading Loading @@ -158,7 +166,7 @@ void hjv( * \param n: `int64_t` * \param n: `int64_t` * \param ier: `int &` * \param ier: `int &` */ */ void lucin(std::complex<double> **am, const int64_t nddmst, int64_t n, int &ier); void lucin(std::complex<double> **am, const np_int nddmst, np_int n, int &ier); /*! \brief Compute the average extinction cross-section. /*! \brief Compute the average extinction cross-section. * * Loading
src/libnptm/algebraic.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -5,26 +5,26 @@ #include <complex> #include <complex> #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "lapacke.h" #include "../include/lapack_calls.h" #include "../include/lapack_calls.h" #endif #endif #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" #endif // >>> FALL-BACK FUNCTIONS DECLARATION <<< // // >>> FALL-BACK FUNCTIONS DECLARATION <<< // extern void lucin(std::complex<double> **mat, int64_t max_size, int64_t size, int &ier); extern void lucin(std::complex<double> **mat, np_int max_size, np_int size, int &ier); // >>> END OF FALL-BACK FUNCTIONS <<< // // >>> END OF FALL-BACK FUNCTIONS <<< // using namespace std; using namespace std; void invert_matrix(std::complex<double> **mat, lapack_int size, int &ier, lapack_int max_size) { void invert_matrix(std::complex<double> **mat, np_int size, int &ier, np_int max_size) { ier = 0; ier = 0; #ifdef USE_LAPACK #ifdef USE_LAPACK zinvert(mat, size, ier); zinvert(mat, size, ier); #else #else lucin(mat, (int64_t)max_size, (int64_t)size, ier); lucin(mat, max_size, size, ier); #endif #endif } }
src/libnptm/clu_subs.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -892,7 +892,7 @@ void hjv( delete[] rfn; delete[] rfn; } } void lucin(std::complex<double> **am, const int64_t nddmst, int64_t n, int &ier) { void lucin(std::complex<double> **am, const np_int nddmst, np_int n, int &ier) { /* NDDMST FIRST DIMENSION OF AM AS DECLARED IN DIMENSION /* NDDMST FIRST DIMENSION OF AM AS DECLARED IN DIMENSION * STATEMENT. * STATEMENT. * N NUMBER OF ROWS IN AM. * N NUMBER OF ROWS IN AM. Loading