eigen-3.2.7-pastix-5.2-backport.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # HG changeset patch
  2. # User Gael Guennebaud <g.gael@free.fr>
  3. # Date 1393589499 -3600
  4. # Node ID b88efb384b160880131ad17e39bb690719112bfa
  5. # Parent 576120ad694efe29b70999576964d3816288fb4e
  6. Fix PaStiX support for Pastix 5.2
  7. diff --git a/Eigen/src/PaStiXSupport/PaStiXSupport.h b/Eigen/src/PaStiXSupport/PaStiXSupport.h
  8. --- a/Eigen/src/PaStiXSupport/PaStiXSupport.h
  9. +++ b/Eigen/src/PaStiXSupport/PaStiXSupport.h
  10. @@ -12,6 +12,14 @@
  11. namespace Eigen {
  12. +#if defined(DCOMPLEX)
  13. + #define PASTIX_COMPLEX COMPLEX
  14. + #define PASTIX_DCOMPLEX DCOMPLEX
  15. +#else
  16. + #define PASTIX_COMPLEX std::complex<float>
  17. + #define PASTIX_DCOMPLEX std::complex<double>
  18. +#endif
  19. +
  20. /** \ingroup PaStiXSupport_Module
  21. * \brief Interface to the PaStix solver
  22. *
  23. @@ -74,14 +82,14 @@
  24. {
  25. if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
  26. if (nbrhs == 0) {x = NULL; nbrhs=1;}
  27. - c_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<COMPLEX*>(vals), perm, invp, reinterpret_cast<COMPLEX*>(x), nbrhs, iparm, dparm);
  28. + c_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_COMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_COMPLEX*>(x), nbrhs, iparm, dparm);
  29. }
  30. void eigen_pastix(pastix_data_t **pastix_data, int pastix_comm, int n, int *ptr, int *idx, std::complex<double> *vals, int *perm, int * invp, std::complex<double> *x, int nbrhs, int *iparm, double *dparm)
  31. {
  32. if (n == 0) { ptr = NULL; idx = NULL; vals = NULL; }
  33. if (nbrhs == 0) {x = NULL; nbrhs=1;}
  34. - z_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<DCOMPLEX*>(vals), perm, invp, reinterpret_cast<DCOMPLEX*>(x), nbrhs, iparm, dparm);
  35. + z_pastix(pastix_data, pastix_comm, n, ptr, idx, reinterpret_cast<PASTIX_DCOMPLEX*>(vals), perm, invp, reinterpret_cast<PASTIX_DCOMPLEX*>(x), nbrhs, iparm, dparm);
  36. }
  37. // Convert the matrix to Fortran-style Numbering