#include #include #include // for nan(), fabs() #include // for malloc(), free() //-- BLAS Level 1 functions ---------------------------------------------------- void dcopy(size_t n, const double *x, ptrdiff_t incX, double *y, ptrdiff_t incY) { for (size_t i=0; imax) { I = i; max = fabs(x[i*incX]); } } return I; } void dswap(size_t n, double *x, ptrdiff_t incX, double *y, ptrdiff_t incY) { for (size_t i=0; iincColA) { dger(n, m, alpha, y, incY, x, incX, A, incColA, incRowA); return; } for (size_t j=0; j0; ) { if (!unit) { x[j*incX] /= A[j*(incRowA+incColA)]; } daxpy(j, -x[j*incX], &A[j*incColA], incRowA, x, incX); } } else { // A is row major for (size_t j=n; j-- >0; ) { x[j*incX] -= ddot(n-1-j, &A[j*incRowA+(j+1)*incColA], incColA, &x[(j+1)*incX], incX); if (!unit) { x[j*incX] /= A[j*(incRowA+incColA)]; } } } } } //-- BLAS Level 3 functions ---------------------------------------------------- void ge_dscal(size_t m, size_t n, double alpha, double *A, ptrdiff_t incRowA, ptrdiff_t incColA) { if (alpha!=0) { for (size_t j=0; j