You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.8 KiB

  1. //=====================================================
  2. // File : blas_interface.hh
  3. // Author : L. Plagne <laurent.plagne@edf.fr)>
  4. // Copyright (C) EDF R&D, lun sep 30 14:23:28 CEST 2002
  5. //=====================================================
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software
  18. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. //
  20. #ifndef blas_PRODUIT_MATRICE_VECTEUR_HH
  21. #define blas_PRODUIT_MATRICE_VECTEUR_HH
  22. #include <c_interface_base.h>
  23. #include <complex>
  24. extern "C"
  25. {
  26. #include "blas.h"
  27. // Cholesky Factorization
  28. // void spotrf_(const char* uplo, const int* n, float *a, const int* ld, int* info);
  29. // void dpotrf_(const char* uplo, const int* n, double *a, const int* ld, int* info);
  30. void ssytrd_(char *uplo, const int *n, float *a, const int *lda, float *d, float *e, float *tau, float *work, int *lwork, int *info );
  31. void dsytrd_(char *uplo, const int *n, double *a, const int *lda, double *d, double *e, double *tau, double *work, int *lwork, int *info );
  32. void sgehrd_( const int *n, int *ilo, int *ihi, float *a, const int *lda, float *tau, float *work, int *lwork, int *info );
  33. void dgehrd_( const int *n, int *ilo, int *ihi, double *a, const int *lda, double *tau, double *work, int *lwork, int *info );
  34. // LU row pivoting
  35. // void dgetrf_( int *m, int *n, double *a, int *lda, int *ipiv, int *info );
  36. // void sgetrf_(const int* m, const int* n, float *a, const int* ld, int* ipivot, int* info);
  37. // LU full pivoting
  38. void sgetc2_(const int* n, float *a, const int *lda, int *ipiv, int *jpiv, int*info );
  39. void dgetc2_(const int* n, double *a, const int *lda, int *ipiv, int *jpiv, int*info );
  40. #ifdef HAS_LAPACK
  41. #endif
  42. }
  43. #define MAKE_STRING2(S) #S
  44. #define MAKE_STRING(S) MAKE_STRING2(S)
  45. #define CAT2(A,B) A##B
  46. #define CAT(A,B) CAT2(A,B)
  47. template<class real> class blas_interface;
  48. static char notrans = 'N';
  49. static char trans = 'T';
  50. static char nonunit = 'N';
  51. static char lower = 'L';
  52. static char right = 'R';
  53. static char left = 'L';
  54. static int intone = 1;
  55. #define SCALAR float
  56. #define SCALAR_PREFIX s
  57. #include "blas_interface_impl.hh"
  58. #undef SCALAR
  59. #undef SCALAR_PREFIX
  60. #define SCALAR double
  61. #define SCALAR_PREFIX d
  62. #include "blas_interface_impl.hh"
  63. #undef SCALAR
  64. #undef SCALAR_PREFIX
  65. #endif