Commit 4faff7e6 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Use vectorized matrix and return error value in LUCIN()

parent 567ee071
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -176,12 +176,12 @@ void hjv(
 * This function performs the inversion of the multi-centered M-matrix through
 * This function performs the inversion of the multi-centered M-matrix through
 * LU decomposition. See Eq. (5.29) in Borghese, Denti & Saija (2007).
 * LU decomposition. See Eq. (5.29) in Borghese, Denti & Saija (2007).
 *
 *
 * \param am: `complex double **`
 * \param vec_am: `complex double *` The matrix to be inverted in vector form.
 * \param nddmst: `const int64_t`
 * \param nddmst: `const int64_t` The maximum size allocated for the matrix.
 * \param n: `int64_t`
 * \param n: `int64_t` The leading dimension of the matrix.
 * \param ier: `int &`
 * \return ier: `int` Error code to return.
 */
 */
void lucin(dcomplex **am, const np_int nddmst, np_int n, int &ier);
int lucin(dcomplex *vec_am, const np_int nddmst, np_int n);


/*! \brief Compute the average extinction cross-section.
/*! \brief Compute the average extinction cross-section.
 *
 *
+2 −2
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ using namespace std;
#endif
#endif


// >>> FALL-BACK FUNCTIONS DECLARATION <<< //
// >>> FALL-BACK FUNCTIONS DECLARATION <<< //
extern void lucin(dcomplex **am, const np_int nddmst, np_int n, int &ier);
extern int lucin(dcomplex *vec_am, const np_int nddmst, np_int n);
// >>>   END OF FALL-BACK FUNCTIONS    <<< //
// >>>   END OF FALL-BACK FUNCTIONS    <<< //


using namespace std;
using namespace std;
@@ -86,6 +86,6 @@ void invert_matrix(dcomplex **mat, np_int size, int &ier, int &maxrefiters, doub
  zinvert(mat, size, ier);
  zinvert(mat, size, ier);
#endif
#endif
#else
#else
  lucin(mat, size, size, ier);
  ier = lucin(mat[0], size, size);
#endif
#endif
}
}