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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. *
  3. * cblas_sspr2.c
  4. * This program is a C interface to sspr2.
  5. * Written by Keita Teranishi
  6. * 4/6/1998
  7. *
  8. */
  9. #include "cblas.h"
  10. #include "cblas_f77.h"
  11. void cblas_sspr2(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
  12. const int N, const float alpha, const float *X,
  13. const int incX, const float *Y, const int incY, float *A)
  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, F77_incY=incY;
  23. #else
  24. #define F77_N N
  25. #define F77_incX incX
  26. #define F77_incY incY
  27. #endif
  28. extern int CBLAS_CallFromC;
  29. extern int RowMajorStrg;
  30. RowMajorStrg = 0;
  31. CBLAS_CallFromC = 1;
  32. if (layout == CblasColMajor)
  33. {
  34. if (Uplo == CblasLower) UL = 'L';
  35. else if (Uplo == CblasUpper) UL = 'U';
  36. else
  37. {
  38. cblas_xerbla(2, "cblas_sspr2","Illegal Uplo setting, %d\n",Uplo );
  39. CBLAS_CallFromC = 0;
  40. RowMajorStrg = 0;
  41. return;
  42. }
  43. #ifdef F77_CHAR
  44. F77_UL = C2F_CHAR(&UL);
  45. #endif
  46. F77_sspr2(F77_UL, &F77_N, &alpha, X, &F77_incX, Y, &F77_incY, A);
  47. } else if (layout == CblasRowMajor)
  48. {
  49. RowMajorStrg = 1;
  50. if (Uplo == CblasLower) UL = 'U';
  51. else if (Uplo == CblasUpper) UL = 'L';
  52. else
  53. {
  54. cblas_xerbla(2, "cblas_sspr2","Illegal Uplo setting, %d\n",Uplo );
  55. CBLAS_CallFromC = 0;
  56. RowMajorStrg = 0;
  57. return;
  58. }
  59. #ifdef F77_CHAR
  60. F77_UL = C2F_CHAR(&UL);
  61. #endif
  62. F77_sspr2(F77_UL, &F77_N, &alpha, X, &F77_incX, Y, &F77_incY, A);
  63. } else cblas_xerbla(1, "cblas_sspr2", "Illegal layout setting, %d\n", layout);
  64. CBLAS_CallFromC = 0;
  65. RowMajorStrg = 0;
  66. }