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_dsbmv.c 2.0 kB

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