Advertisement
cosminBoaca

Untitled

Apr 18th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. void optimized_dtrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side,
  2. const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA,
  3. const enum CBLAS_DIAG Diag, const int M, const int N,
  4. const double alpha, const double *A, const int lda,
  5. double *B, const int ldb)
  6. {
  7. int i, j, k;
  8. register double aux;
  9. register double *pbij, *pbkj;
  10.  
  11. assert(Side == CblasLeft);
  12. assert(TransA == CblasNoTrans);
  13. assert(Uplo == CblasUpper);
  14. assert(Diag == CblasUnit);
  15.  
  16. for (k = M - 1; k >= 0; --k) {
  17. for (i = 0; i < k; ++i) {
  18. aux = A[i * M + k];
  19. pbij = B + i * N;
  20. pbkj = B + k * N;
  21. for (j = 0; j < N; ++j) {
  22. *pbij++ -= *pbkj++ * aux;
  23. }
  24. }
  25. }
  26.  
  27. for (i = 0; i < M; ++i) {
  28. pbij = B + i * N;
  29. for (j = i; j < N; ++j) {
  30. *pbij++ *= alpha;
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement