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_dspr.c 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. *
  3. * cblas_dspr.c
  4. * This program is a C interface to dspr.
  5. * Written by Keita Teranishi
  6. * 4/6/1998
  7. *
  8. */
  9. #include "cblas.h"
  10. #include "cblas_f77.h"
  11. void cblas_dspr(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
  12. const int N, const double alpha, const double *X,
  13. const int incX, double *Ap)
  14. {
  15. char UL;
  16. #ifdef F77_CHAR
  17. F77_CHAR F77_UL;
  18. #else
  19. #define F77_UL &UL
  20. #endif
  21. #ifdef F77_INT
  22. F77_INT F77_N=N, F77_incX=incX;
  23. #else
  24. #define F77_N N
  25. #define F77_incX incX
  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_dspr","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_dspr(F77_UL, &F77_N, &alpha, X, &F77_incX, Ap);
  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_dspr","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_dspr(F77_UL, &F77_N, &alpha, X, &F77_incX, Ap);
  62. } else cblas_xerbla(1, "cblas_dspr", "Illegal layout setting, %d\n", layout);
  63. CBLAS_CallFromC = 0;
  64. RowMajorStrg = 0;
  65. return;
  66. }