36 #include <visp3/core/vpConfig.h> 37 #include <visp3/core/vpMatrix.h> 39 #ifndef DOXYGEN_SHOULD_SKIP_THIS 46 #if defined(VISP_HAVE_LAPACK) 49 typedef MKL_INT integer;
51 void vpMatrix::blas_dgemm(
char trans_a,
char trans_b,
unsigned int M_,
unsigned int N_,
unsigned int K_,
double alpha,
52 double *a_data,
unsigned int lda_,
double *b_data,
unsigned int ldb_,
double beta,
double *c_data,
55 MKL_INT M =
static_cast<MKL_INT
>(M_);
56 MKL_INT N =
static_cast<MKL_INT
>(N_);
57 MKL_INT K =
static_cast<MKL_INT
>(K_);
58 MKL_INT lda =
static_cast<MKL_INT
>(lda_);
59 MKL_INT ldb =
static_cast<MKL_INT
>(ldb_);
60 MKL_INT ldc =
static_cast<MKL_INT
>(ldc_);
62 dgemm(&trans_a, &trans_b, &M, &N, &K, &alpha, a_data, &lda, b_data, &ldb, &beta, c_data, &ldc);
65 void vpMatrix::blas_dgemv(
char trans,
unsigned int M_,
unsigned int N_,
double alpha,
double *a_data,
unsigned int lda_,
66 double *x_data,
int incx_,
double beta,
double *y_data,
int incy_)
68 MKL_INT M =
static_cast<MKL_INT
>(M_);
69 MKL_INT N =
static_cast<MKL_INT
>(N_);
70 MKL_INT lda =
static_cast<MKL_INT
>(lda_);
71 MKL_INT incx =
static_cast<MKL_INT
>(incx_);
72 MKL_INT incy =
static_cast<MKL_INT
>(incy_);
74 dgemv(&trans, &M, &N, &alpha, a_data, &lda, x_data, &incx, &beta, y_data, &incy);
76 # elif !defined(VISP_HAVE_GSL) 77 # ifdef VISP_HAVE_LAPACK_BUILT_IN 78 typedef long int integer;
83 extern "C" void dgemm_(
char *transa,
char *transb, integer *M, integer *N, integer *K,
double *alpha,
double *a,
84 integer *lda,
double *b, integer *ldb,
double *beta,
double *c, integer *ldc);
86 extern "C" void dgemv_(
char *trans, integer *M, integer *N,
double *alpha,
double *a, integer *lda,
double *x,
87 integer *incx,
double *beta,
double *y, integer *incy);
89 void vpMatrix::blas_dgemm(
char trans_a,
char trans_b,
unsigned int M_,
unsigned int N_,
unsigned int K_,
double alpha,
90 double *a_data,
unsigned int lda_,
double *b_data,
unsigned int ldb_,
double beta,
double *c_data,
93 integer M =
static_cast<integer
>(M_);
94 integer K =
static_cast<integer
>(K_);
95 integer N =
static_cast<integer
>(N_);
96 integer lda =
static_cast<integer
>(lda_);
97 integer ldb =
static_cast<integer
>(ldb_);
98 integer ldc =
static_cast<integer
>(ldc_);
100 dgemm_(&trans_a, &trans_b, &M, &N, &K, &alpha, a_data, &lda, b_data, &ldb, &beta, c_data, &ldc);
103 void vpMatrix::blas_dgemv(
char trans,
unsigned int M_,
unsigned int N_,
double alpha,
double *a_data,
unsigned int lda_,
104 double *x_data,
int incx_,
double beta,
double *y_data,
int incy_)
106 integer M =
static_cast<integer
>(M_);
107 integer N =
static_cast<integer
>(N_);
108 integer lda =
static_cast<integer
>(lda_);
109 integer incx =
static_cast<integer
>(incx_);
110 integer incy =
static_cast<integer
>(incy_);
112 dgemv_(&trans, &M, &N, &alpha, a_data, &lda, x_data, &incx, &beta, y_data, &incy);
118 void dummy_vpMatrix_blas() {};
121 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS