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

cblas_dspr2.c 1.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * cblas_dspr2.c
  3. * The program is a C interface to dspr2.
  4. *
  5. * Keita Teranishi 5/20/98
  6. *
  7. */
  8. #include "cblas.h"
  9. #include "cblas_f77.h"
  10. void cblas_dspr2(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
  11. const int N, const double alpha, const double *X,
  12. const int incX, const double *Y, const int incY, double *A)
  13. {
  14. char UL;
  15. #ifdef F77_CHAR
  16. F77_CHAR F77_UL;
  17. #else
  18. #define F77_UL &UL
  19. #endif
  20. #ifdef F77_INT
  21. F77_INT F77_N=N, F77_incX=incX, F77_incY=incY;
  22. #else
  23. #define F77_N N
  24. #define F77_incX incX
  25. #define F77_incY incY
  26. #endif
  27. extern int CBLAS_CallFromC;
  28. extern int RowMajorStrg;
  29. RowMajorStrg = 0;
  30. CBLAS_CallFromC = 1;
  31. if (layout == CblasColMajor)
  32. {
  33. if (Uplo == CblasLower) UL = 'L';
  34. else if (Uplo == CblasUpper) UL = 'U';
  35. else
  36. {
  37. cblas_xerbla(2, "cblas_dspr2","Illegal Uplo setting, %d\n",Uplo );
  38. CBLAS_CallFromC = 0;
  39. RowMajorStrg = 0;
  40. return;
  41. }
  42. #ifdef F77_CHAR
  43. F77_UL = C2F_CHAR(&UL);
  44. #endif
  45. F77_dspr2(F77_UL, &F77_N, &alpha, X, &F77_incX, Y, &F77_incY, A);
  46. } else if (layout == CblasRowMajor)
  47. {
  48. RowMajorStrg = 1;
  49. if (Uplo == CblasLower) UL = 'U';
  50. else if (Uplo == CblasUpper) UL = 'L';
  51. else
  52. {
  53. cblas_xerbla(2, "cblas_dspr2","Illegal Uplo setting, %d\n",Uplo );
  54. CBLAS_CallFromC = 0;
  55. RowMajorStrg = 0;
  56. return;
  57. }
  58. #ifdef F77_CHAR
  59. F77_UL = C2F_CHAR(&UL);
  60. #endif
  61. F77_dspr2(F77_UL, &F77_N, &alpha, X, &F77_incX, Y, &F77_incY, A);
  62. } else cblas_xerbla(1, "cblas_dspr2", "Illegal layout setting, %d\n", layout);
  63. CBLAS_CallFromC = 0;
  64. RowMajorStrg = 0;
  65. return;
  66. }