31 #include <mkl_cblas.h> 50 #elif defined (OPENBLAS_CONFIG_H) 52 #elif defined (INT_64BITS) 53 typedef long long int INTT;
64 cblas_iamax(
const INTT N,
const T *X,
const INTT incX);
65 template <
class T>
inline T
66 cblas_nrm2(
const INTT N,
const T *X,
const INTT incX);
67 template <
class T>
inline T
68 cblas_asum(
const INTT N,
const T *X,
const INTT incX);
72 cblas_iamin(
const INTT N,
const T *X,
const INTT incX);
76 template <
class T>
inline T
77 cblas_dot(
const INTT N,
const T *X,
const INTT incX,
const T *Y,
const INTT incY);
79 template <
class T>
inline void 80 cblas_copy(
const INTT N,
const T *X,
const INTT incX, T *Y,
const INTT incY);
82 template <
class T>
inline void 83 cblas_swap(
const INTT N, T *X,
const INTT incX, T *Y,
const INTT incY);
85 template <
class T>
inline void 86 cblas_scal (
const INTT N,
const T alpha, T *X,
const INTT incX);
94 template <
class T>
inline void 95 cblas_ger(
const CBLAS_ORDER order,
const INTT M,
const INTT N,
const T alpha,
const T *X,
const INTT incX,
const T *Y,
const INTT incY, T *A,
const INTT lda);
98 template <
class T>
inline void 102 template <
class T>
inline void 103 cblas_gemv(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const INTT M,
const INTT N,
const T alpha,
const T *A,
const INTT lda,
const T *X,
const INTT incX,
const T beta, T *Y,
const INTT incY);
111 template <
class T>
inline void 112 cblas_gemm(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const CBLAS_TRANSPOSE TransB,
const INTT M,
const INTT N,
const INTT K,
const T alpha,
const T *A,
const INTT lda,
const T *B,
const INTT ldb,
const T beta, T *C,
const INTT ldc);
115 template <
class T>
inline void 116 cblas_syrk(
CBLAS_ORDER order,
CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE Trans, INTT N, INTT K, T alpha, T *A, INTT lda, T beta, T*C, INTT ldc);
120 template <
class T>
inline void 121 cblas_axpby (
const INTT N,
const T alpha,
const T *X,
const INTT incX,
const T beta, T *Y,
const INTT incY);
137 cblas_iamax<std::complex<double> >(
const INTT N,
const std::complex<double> *X,
const INTT incX)
142 cblas_iamax<std::complex<float> >(
const INTT N,
const std::complex<float> *X,
const INTT incX)
149 cblas_iamin<double>(
const INTT N,
const double *X,
const INTT incX)
154 cblas_iamin<float>(
const INTT N,
const float *X,
const INTT incX)
159 cblas_iamin<std::complex<double> >(
const INTT N,
const std::complex<double> *X,
const INTT incX)
161 return cblas_izamin(N,X,incX);
164 cblas_iamin<std::complex<float> >(
const INTT N,
const std::complex<float> *X,
const INTT incX)
166 return cblas_icamin(N,X,incX);
173 std::vector<double> vec(N);
174 for (
int i = 0; i < N; i = i+incX )
178 for (
int ii = vec.begin(); ii!=iter; ++ii )
186 std::vector<double> vec(N);
187 for (
int i = 0; i < N; i = i+incX )
191 for (
int ii = vec.begin(); ii!=iter; ++ii )
197 template <>
inline double 202 template <>
inline float 208 cblas_nrm2(
const INTT N,
const std::complex<double> *X,
const INTT incX)
213 cblas_nrm2(
const INTT N,
const std::complex<float> *X,
const INTT incX)
218 template <>
inline double 223 template <>
inline float 229 cblas_asum(
const INTT N,
const std::complex<double> *X,
const INTT incX)
234 cblas_asum(
const INTT N,
const std::complex<float> *X,
const INTT incX)
240 template <>
inline double 241 cblas_dot<double>(
const INTT N,
const double *X,
const INTT incX,
const double *Y,
const INTT incY)
245 template <>
inline float 246 cblas_dot<float>(
const INTT N,
const float *X,
const INTT incX,
const float *Y,
const INTT incY)
251 inline std::complex<double>
252 cblas_dot<std::complex<double> >(
const INTT N,
const std::complex<double> *X,
const INTT incX,
const std::complex<double> *Y,
const INTT incY)
254 std::complex<double> result;
259 template <>
inline void 264 template <>
inline void 269 template <>
inline void 270 cblas_copy<std::complex<double> >(
const INTT N,
const std::complex<double> *X,
const INTT incX, std::complex<double> *Y,
const INTT incY)
274 template <>
inline void 275 cblas_copy<std::complex<float> >(
const INTT N,
const std::complex<float> *X,
const INTT incX, std::complex<float> *Y,
const INTT incY)
280 template <>
inline void 285 template <>
inline void 291 template <>
inline void 296 template <>
inline void 301 template <>
inline void 302 cblas_scal<std::complex<double> >(
const INTT N,
const std::complex<double> alpha, std::complex<double> *X,
const INTT incX)
306 template <>
inline void 307 cblas_scal<std::complex<float> >(
const INTT N,
const std::complex<float> alpha, std::complex<float> *X,
const INTT incX)
315 template <>
inline void 316 cblas_ger<float>(
const CBLAS_ORDER order,
const INTT M,
const INTT N,
const float alpha,
const float *X,
const INTT incX,
const float *Y,
const INTT incY,
float *A,
const INTT lda)
318 cblas_sger(order,M,N,alpha,X,incX,Y,incY,A,lda);
320 template <>
inline void 321 cblas_ger<double>(
const CBLAS_ORDER order,
const INTT M,
const INTT N,
const double alpha,
const double *X,
const INTT incX,
const double *Y,
const INTT incY,
double *A,
const INTT lda)
323 cblas_dger(order,M,N,alpha,X,incX,Y,incY,A,lda);
326 template <>
inline void 331 template <>
inline void 337 template <>
inline void 338 cblas_gemv<double>(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const INTT M,
const INTT N,
const double alpha,
const double *A,
const INTT lda,
const double *X,
const INTT incX,
const double beta,
double *Y,
const INTT incY)
340 cblas_dgemv(order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY);
342 template <>
inline void 343 cblas_gemv<float>(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const INTT M,
const INTT N,
const float alpha,
const float *A,
const INTT lda,
const float *X,
const INTT incX,
const float beta,
float *Y,
const INTT incY)
345 cblas_sgemv(order,TransA,M,N,alpha,A,lda,X,incX,beta,Y,incY);
347 template <>
inline void 348 cblas_gemv<std::complex<double> >(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const INTT M,
const INTT N,
const std::complex<double> alpha,
const std::complex<double> *A,
const INTT lda,
const std::complex<double> *X,
const INTT incX,
const std::complex<double> beta, std::complex<double> *Y,
const INTT incY)
350 cblas_zgemv(order,TransA,M,N,&alpha,A,lda,X,incX,&beta,Y,incY);
352 template <>
inline void 353 cblas_gemv<std::complex<float> >(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const INTT M,
const INTT N,
const std::complex<float> alpha,
const std::complex<float> *A,
const INTT lda,
const std::complex<float> *X,
const INTT incX,
const std::complex<float> beta, std::complex<float> *Y,
const INTT incY)
355 cblas_cgemv(order,TransA,M,N,&alpha,A,lda,X,incX,&beta,Y,incY);
362 template <>
inline void 363 cblas_gemm<double>(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const CBLAS_TRANSPOSE TransB,
const INTT M,
const INTT N,
const INTT K,
const double alpha,
const double *A,
const INTT lda,
const double *B,
const INTT ldb,
const double beta,
double *C,
const INTT ldc)
365 cblas_dgemm(order,TransA,TransB,M,N,K,alpha,A,lda,B,ldb,beta,C,ldc);
367 template <>
inline void 368 cblas_gemm<float>(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const CBLAS_TRANSPOSE TransB,
const INTT M,
const INTT N,
const INTT K,
const float alpha,
const float *A,
const INTT lda,
const float *B,
const INTT ldb,
const float beta,
float *C,
const INTT ldc)
370 cblas_sgemm(order,TransA,TransB,M,N,K,alpha,A,lda,B,ldb,beta,C,ldc);
372 template <>
inline void 373 cblas_gemm<std::complex<double> >(
const CBLAS_ORDER order,
const CBLAS_TRANSPOSE TransA,
const CBLAS_TRANSPOSE TransB,
const INTT M,
const INTT N,
const INTT K,
const std::complex<double> alpha,
const std::complex<double> *A,
const INTT lda,
const std::complex<double> *B,
const INTT ldb,
const std::complex<double> beta, std::complex<double> *C,
const INTT ldc)
375 cblas_zgemm(order,TransA,TransB,M,N,K,&alpha,A,lda,B,ldb,&beta,C,ldc);
378 template <>
inline void 379 cblas_syrk<double>(
CBLAS_ORDER order,
CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE Trans, INTT N, INTT K,
double alpha,
double *A, INTT lda,
double beta,
double *C, INTT ldc)
381 cblas_dsyrk(order,Uplo,Trans,N,K,alpha,A,lda,beta,C,ldc);
383 template <>
inline void 384 cblas_syrk<float>(
CBLAS_ORDER order,
CBLAS_UPLO Uplo,
CBLAS_TRANSPOSE Trans, INTT N, INTT K,
float alpha,
float *A, INTT lda,
float beta,
float *C, INTT ldc)
386 cblas_ssyrk(order,Uplo,Trans,N,K,alpha,A,lda,beta,C,ldc);
391 template <>
inline void 392 cblas_axpby<double>(
const INTT N,
const double alpha,
const double *X,
const INTT incX,
const double beta,
double *Y,
const INTT incY)
394 cblas_daxpby(N,alpha,X,incX,beta,Y,incY);
396 template <>
inline void 397 cblas_axpby<float>(
const INTT N,
const float alpha,
const float *X,
const INTT incX,
const float beta,
float *Y,
const INTT incY)
399 cblas_saxpby(N,alpha,X,incX,beta,Y,incY);
401 template <>
inline void 402 cblas_axpby<std::complex<double> >(
const INTT N,
const std::complex<double> alpha,
const std::complex<double> *X,
const INTT incX,
const std::complex<double> beta, std::complex<double> *Y,
const INTT incY)
404 cblas_zaxpby(N,&alpha,X,incX,&beta,Y,incY);
406 template <>
inline void 407 cblas_axpby<std::complex<float> >(
const INTT N,
const std::complex<float> alpha,
const std::complex<float> *X,
const INTT incX,
const std::complex<float> beta, std::complex<float> *Y,
const INTT incY)
409 cblas_zaxpby(N,&alpha,X,incX,&beta,Y,incY);
412 template <
typename T>
inline void 413 cblas_axpby(
const INTT N,
const T alpha,
const T *X,
const INTT incX,
const T beta, T *Y,
const INTT incY)
415 for (
int i=0, j=0; i<N, j<N; i+=incX, j+=incY )
416 Y[j] = alpha*X[i] + beta*Y[j];
433 #define __utl_gemm_MatrixTimesMatrix(T, FuncName, FuncHelperName, RowMajorMatrixName, GetRowsFuncName, GetColsFuncName, GetDataFuncName, ReSizeFuncName) \ 436 FuncName(const bool bATrans, const bool bBTrans, const T alpha, const RowMajorMatrixName& A, const RowMajorMatrixName& B, const T beta, RowMajorMatrixName& C) \ 438 CBLAS_TRANSPOSE transA, transB; \ 439 unsigned int M = 0, N = 0, K = 0; \ 440 if(!bATrans && !bBTrans) \ 442 transA = CblasNoTrans; \ 443 transB = CblasNoTrans; \ 444 M = A.GetRowsFuncName(); \ 445 N = B.GetColsFuncName(); \ 446 K = A.GetColsFuncName(); \ 447 utlSAException(A.GetColsFuncName() != B.GetRowsFuncName())(A.GetColsFuncName())(B.GetRowsFuncName()).msg("matrix dimension mismatch"); \ 449 else if(bATrans && !bBTrans) \ 451 transA = CblasTrans; \ 452 transB = CblasNoTrans; \ 453 M = A.GetColsFuncName(); \ 454 N = B.GetColsFuncName(); \ 455 K = A.GetRowsFuncName(); \ 456 utlSAException(A.GetRowsFuncName() != B.GetRowsFuncName())(A.GetRowsFuncName())(B.GetRowsFuncName()).msg("matrix dimension mismatch"); \ 458 else if(!bATrans && bBTrans) \ 460 transA = CblasNoTrans; \ 461 transB = CblasTrans; \ 462 M = A.GetRowsFuncName(); \ 463 N = B.GetRowsFuncName(); \ 464 K = A.GetColsFuncName(); \ 465 utlSAException(A.GetColsFuncName() != B.GetColsFuncName())(A.GetColsFuncName())(B.GetColsFuncName()).msg("matrix dimension mismatch"); \ 469 transA = CblasTrans; \ 470 transB = CblasTrans; \ 471 M = A.GetColsFuncName(); \ 472 N = B.GetRowsFuncName(); \ 473 K = A.GetRowsFuncName(); \ 474 utlSAException(A.GetRowsFuncName() != B.GetColsFuncName())(A.GetRowsFuncName())(B.GetColsFuncName()).msg("matrix dimension mismatch"); \ 476 utl::cblas_gemm(CblasRowMajor, transA, transB, M, N, K, alpha, A.GetDataFuncName(), A.GetColsFuncName(), B.GetDataFuncName(), B.GetColsFuncName(), beta, C.GetDataFuncName(), C.GetColsFuncName()); \ 482 Product##FuncHelperName##MM(const RowMajorMatrixName& A, const RowMajorMatrixName& B, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0) \ 484 C.ReSizeFuncName(A.GetRowsFuncName(), B.GetColsFuncName()); \ 485 FuncName<T>(false, false, alpha, A, B, beta, C); \ 490 Product##FuncHelperName##MM(const RowMajorMatrixName& A1, const RowMajorMatrixName& A2, const RowMajorMatrixName& A3, RowMajorMatrixName& C) \ 492 RowMajorMatrixName tmp; \ 493 Product##FuncHelperName##MM<T>(A1, A2, tmp); \ 494 Product##FuncHelperName##MM<T>(tmp, A3, C); \ 499 Product##FuncHelperName##MM(const RowMajorMatrixName& A1, const RowMajorMatrixName& A2, const RowMajorMatrixName& A3, const RowMajorMatrixName& A4, RowMajorMatrixName& C) \ 501 RowMajorMatrixName tmp; \ 502 Product##FuncHelperName##MM<T>(A1, A2, A3, tmp); \ 503 Product##FuncHelperName##MM<T>(tmp, A4, C); \ 508 Product##FuncHelperName##MM(const RowMajorMatrixName& A1, const RowMajorMatrixName& A2, const RowMajorMatrixName& A3, const RowMajorMatrixName& A4, const RowMajorMatrixName& A5, RowMajorMatrixName& C) \ 510 RowMajorMatrixName tmp; \ 511 Product##FuncHelperName##MM<T>(A1, A2, A3, A4, tmp); \ 512 Product##FuncHelperName##MM<T>(tmp, A5, C); \ 517 Product##FuncHelperName##MtM(const RowMajorMatrixName& A, const RowMajorMatrixName& B, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0) \ 519 C.ReSizeFuncName(A.GetColsFuncName(), B.GetColsFuncName()); \ 520 FuncName<T>(true, false, alpha, A, B, beta, C); \ 525 Product##FuncHelperName##MMt(const RowMajorMatrixName& A, const RowMajorMatrixName& B, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0) \ 527 C.ReSizeFuncName(A.GetRowsFuncName(), B.GetRowsFuncName()); \ 528 FuncName<T>(false, true, alpha, A, B, beta, C); \ 533 Product##FuncHelperName##MtMt(const RowMajorMatrixName& A, const RowMajorMatrixName& B, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0) \ 535 C.ReSizeFuncName(A.GetColsFuncName(), B.GetRowsFuncName()); \ 536 FuncName<T>(true, true, alpha, A, B, beta, C); \ 551 #define __utl_gemv_MatrixTimesVector(T, FuncName, FuncHelperName, RowMajorMatrixName, GetRowsFuncName, GetColsFuncName, MatrixGetDataFuncName, VectorName, GetSizeFuncName, VectorGetDataFuncName, ReSizeFuncName) \ 554 FuncName(const bool bATrans, const T alpha, const RowMajorMatrixName& A, const VectorName& X, const T beta, VectorName& Y) \ 556 CBLAS_TRANSPOSE TransA; \ 559 TransA = CblasTrans; \ 560 utlSAException(A.GetRowsFuncName() != X.GetSizeFuncName())(A.GetRowsFuncName())(X.GetSizeFuncName()).msg("matrix and vector dimension mismatch"); \ 564 TransA = CblasNoTrans; \ 565 utlSAException(A.GetColsFuncName() != X.GetSizeFuncName())(A.GetColsFuncName())(X.GetSizeFuncName()).msg("matrix and vector dimension mismatch"); \ 567 utl::cblas_gemv<T>(CblasRowMajor, TransA, A.GetRowsFuncName(), A.GetColsFuncName(), alpha, A.MatrixGetDataFuncName(), A.GetColsFuncName(), X.VectorGetDataFuncName(), 1, beta, Y.VectorGetDataFuncName(), 1); \ 573 Product##FuncHelperName##Mv(const RowMajorMatrixName& A, const VectorName& b, VectorName& c, const double alpha=1.0, const double beta=0.0) \ 575 c.ReSizeFuncName(A.GetRowsFuncName()); \ 576 FuncName<T>(false, alpha, A, b, beta, c); \ 581 Product##FuncHelperName##Mtv(const RowMajorMatrixName& A, const VectorName& b, VectorName& c, const double alpha=1.0, const double beta=0.0) \ 583 c.ReSizeFuncName(A.GetColsFuncName()); \ 584 FuncName<T>(true, alpha, A, b, beta, c); \ 593 #define __utl_gevm_MatrixTimesVector(T, FuncName, FuncHelperName, RowMajorMatrixName, GetRowsFuncName, GetColsFuncName, MatrixGetDataFuncName, VectorName, GetSizeFuncName, VectorGetDataFuncName, ReSizeFuncName) \ 596 FuncName(const bool bATrans, const T alpha, const VectorName& X, const RowMajorMatrixName& A, const T beta, VectorName& Y) \ 598 CBLAS_TRANSPOSE transA; \ 599 unsigned int M = 1, N = 0, K = 0; \ 602 transA = CblasTrans; \ 603 N = A.GetRowsFuncName(); \ 604 K = A.GetColsFuncName(); \ 605 utlSAException(A.GetColsFuncName() != X.GetSizeFuncName())(A.GetColsFuncName())(X.GetSizeFuncName()).msg("matrix and vector dimension mismatch"); \ 609 N = A.GetColsFuncName(); \ 610 K = A.GetRowsFuncName(); \ 611 transA = CblasNoTrans; \ 612 utlSAException(A.GetRowsFuncName() != X.GetSizeFuncName())(A.GetRowsFuncName())(X.GetSizeFuncName()).msg("matrix and vector dimension mismatch"); \ 614 utl::cblas_gemm<T>(CblasRowMajor, CblasNoTrans, transA, M, N, K, alpha, X.VectorGetDataFuncName(), X.GetSizeFuncName(), A.MatrixGetDataFuncName(), A.GetColsFuncName(), beta, Y.VectorGetDataFuncName(), Y.GetSizeFuncName()); \ 620 Product##FuncHelperName##vM(const VectorName& b, const RowMajorMatrixName& A, VectorName& c, const double alpha=1.0, const double beta=0.0) \ 622 c.ReSizeFuncName(A.GetColsFuncName()); \ 623 FuncName<T>(false, alpha, b, A, beta, c); \ 628 Product##FuncHelperName##vMt(const VectorName& b, const RowMajorMatrixName& A, VectorName& c, const double alpha=1.0, const double beta=0.0) \ 630 c.ReSizeFuncName(A.GetRowsFuncName()); \ 631 FuncName<T>(true, alpha, b, A, beta, c); \ 646 #define __utl_syrk_Matrix(T, FuncName, FuncHelperName, RowMajorMatrixName, GetRowsFuncName, GetColsFuncName, GetDataFuncName, ReSizeFuncName) \ 649 FuncName( const bool trans, const T alpha, const RowMajorMatrixName& A, const T beta, RowMajorMatrixName& C ) \ 651 int size = C.GetRowsFuncName()*C.GetColsFuncName(); \ 652 utlSAException(size>0 && C.GetRowsFuncName()!=C.GetColsFuncName())(C.GetRowsFuncName())(C.GetColsFuncName()).msg("C should be symmetric matrix or empty matrix"); \ 653 CBLAS_TRANSPOSE transBlas; \ 657 utlSAException(size>0 && A.GetRowsFuncName()!=C.GetRowsFuncName())(A.GetRowsFuncName())(C.GetRowsFuncName()).msg("wrong size"); \ 658 transBlas=CblasNoTrans; \ 659 N = A.GetRowsFuncName(); \ 660 K = A.GetColsFuncName(); \ 664 utlSAException(size>0 && A.GetColsFuncName()!=C.GetRowsFuncName())(A.GetColsFuncName())(C.GetRowsFuncName()).msg("wrong size"); \ 665 transBlas=CblasTrans; \ 666 N = A.GetColsFuncName(); \ 667 K = A.GetRowsFuncName(); \ 669 utlException(size>0 && (C.GetRowsFuncName()!=N || C.GetColsFuncName()!=N), "wrong size of C"); \ 672 utlSAException(std::fabs(beta)>1e-10)(beta)(C.GetRowsFuncName())(C.GetColsFuncName()).msg("when C is empty matrix, beta should be zero"); \ 673 C.ReSizeFuncName(N,N); \ 675 RowMajorMatrixName B=A; \ 676 utl::cblas_syrk<T>(CblasRowMajor, CblasUpper, transBlas, N, K, alpha, B.GetDataFuncName(), B.GetColsFuncName(), beta, C.GetDataFuncName(), N); \ 678 T* data = C.GetDataFuncName(); \ 679 for ( int i = 0; i < C.GetRowsFuncName(); ++i ) \ 680 for ( int j = 0; j < i; ++j ) \ 681 data[i*N+j] = data[j*N+i]; \ 686 Product##FuncHelperName##XXt ( const RowMajorMatrixName& A, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0 ) \ 688 FuncName<T>(false, alpha, A, beta, C); \ 692 Product##FuncHelperName##XtX ( const RowMajorMatrixName& A, RowMajorMatrixName& C, const double alpha=1.0, const double beta=0.0 ) \ 694 FuncName<T>(true, alpha, A, beta, C); \ void cblas_syrk< double >(CBLAS_ORDER order, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, INTT N, INTT K, double alpha, double *A, INTT lda, double beta, double *C, INTT ldc)
void cblas_ger< float >(const CBLAS_ORDER order, const INTT M, const INTT N, const float alpha, const float *X, const INTT incX, const float *Y, const INTT incY, float *A, const INTT lda)
double cblas_asum< double >(const INTT N, const double *X, const INTT incX)
T min_element(const std::vector< T > &v)
void cblas_scal< double >(const INTT N, const double alpha, double *X, const INTT incX)
void cblas_copy(const INTT N, const T *X, const INTT incX, T *Y, const INTT incY)
void cblas_syrk< float >(CBLAS_ORDER order, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, INTT N, INTT K, float alpha, float *A, INTT lda, float beta, float *C, INTT ldc)
void cblas_dscal(const int N, const double alpha, double *X, const int incX)
void cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc)
int cblas_iamax< float >(const INTT N, const float *X, const INTT incX)
void cblas_scal(const INTT N, const T alpha, T *X, const INTT incX)
void cblas_ssyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const float alpha, const float *X, const int incX, float *A, const int lda)
void cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const void *alpha, const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc)
vcl_size_t cblas_idamin(int n, double *X, int incX)
external functions
void cblas_gemm< float >(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const INTT M, const INTT N, const INTT K, const float alpha, const float *A, const INTT lda, const float *B, const INTT ldb, const float beta, float *C, const INTT ldc)
int cblas_iamax(const INTT N, const T *X, const INTT incX)
interface to cblas_i*amax
void cblas_cgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha, const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY)
void cblas_cscal(const int N, const void *alpha, void *X, const int incX)
void cblas_ger(const CBLAS_ORDER order, const INTT M, const INTT N, const T alpha, const T *X, const INTT incX, const T *Y, const INTT incY, T *A, const INTT lda)
float cblas_sasum(const int N, const float *X, const int incX)
double cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY)
void cblas_zgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha, const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY)
double cblas_dot< double >(const INTT N, const double *X, const INTT incX, const double *Y, const INTT incY)
vcl_size_t cblas_isamin(int n, float *X, int incX)
void cblas_scopy(const int N, const float *X, const int incX, float *Y, const int incY)
void cblas_axpby(const INTT N, const T alpha, const T *X, const INTT incX, const T beta, T *Y, const INTT incY)
void cblas_syr(const CBLAS_ORDER order, const CBLAS_UPLO Uplo, const INTT N, const T alpha, const T *X, const INTT incX, T *A, const INTT lda)
void cblas_copy< float >(const INTT N, const float *X, const INTT incX, float *Y, const INTT incY)
void cblas_zscal(const int N, const void *alpha, void *X, const int incX)
void cblas_gemm< double >(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const INTT M, const INTT N, const INTT K, const double alpha, const double *A, const INTT lda, const double *B, const INTT ldb, const double beta, double *C, const INTT ldc)
double cblas_dznrm2(const int N, const void *X, const int incX)
float cblas_snrm2(const int N, const float *X, const int incX)
double cblas_dnrm2(const int N, const double *X, const int incX)
int cblas_idamax(const int N, const double *X, const int incX)
float cblas_nrm2< float >(const INTT N, const float *X, const INTT incX)
void cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const float alpha, const float *A, const int lda, const float beta, float *C, const int ldc)
void cblas_gemv< float >(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const INTT M, const INTT N, const float alpha, const float *A, const INTT lda, const float *X, const INTT incX, const float beta, float *Y, const INTT incY)
void cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc)
void cblas_swap(const INTT N, T *X, const INTT incX, T *Y, const INTT incY)
T abs(const T x)
template version of the fabs function
void cblas_sswap(const int N, float *X, const int incX, float *Y, const int incY)
float cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY)
double cblas_dzasum(const int N, const void *X, const int incX)
void cblas_ger< double >(const CBLAS_ORDER order, const INTT M, const INTT N, const double alpha, const double *X, const INTT incX, const double *Y, const INTT incY, double *A, const INTT lda)
void cblas_dger(const enum CBLAS_ORDER Order, const int M, const int N, const double alpha, const double *X, const int incX, const double *Y, const int incY, double *A, const int lda)
float cblas_asum< float >(const INTT N, const float *X, const INTT incX)
void cblas_scal< float >(const INTT N, const float alpha, float *X, const INTT incX)
void cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, const int N, const int K, const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc)
void cblas_zcopy(const int N, const void *X, const int incX, void *Y, const int incY)
float cblas_scnrm2(const int N, const void *X, const int incX)
int cblas_icamax(const int N, const void *X, const int incX)
T cblas_asum(const INTT N, const T *X, const INTT incX)
int cblas_iamin(const INTT N, const T *X, const INTT incX)
interface to cblas_i*amin
void cblas_syrk(CBLAS_ORDER order, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, INTT N, INTT K, T alpha, T *A, INTT lda, T beta, T *C, INTT ldc)
int cblas_izamax(const int N, const void *X, const int incX)
void cblas_dswap(const int N, double *X, const int incX, double *Y, const int incY)
float cblas_scasum(const int N, const void *X, const int incX)
void cblas_zdotc_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotc)
void cblas_sgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha, const float *A, const int lda, const float *X, const int incX, const float beta, float *Y, const int incY)
void cblas_copy< double >(const INTT N, const double *X, const INTT incX, double *Y, const INTT incY)
double cblas_nrm2< double >(const INTT N, const double *X, const INTT incX)
int cblas_isamax(const int N, const float *X, const int incX)
T cblas_dot(const INTT N, const T *X, const INTT incX, const T *Y, const INTT incY)
double cblas_dasum(const int N, const double *X, const int incX)
void cblas_gemm(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const INTT M, const INTT N, const INTT K, const T alpha, const T *A, const INTT lda, const T *B, const INTT ldb, const T beta, T *C, const INTT ldc)
void cblas_syr< double >(const CBLAS_ORDER order, const CBLAS_UPLO Uplo, const INTT N, const double alpha, const double *X, const INTT incX, double *A, const INTT lda)
void cblas_swap< float >(const INTT N, float *X, const INTT incX, float *Y, const INTT incY)
void cblas_syr< float >(const CBLAS_ORDER order, const CBLAS_UPLO Uplo, const INTT N, const float alpha, const float *X, const INTT incX, float *A, const INTT lda)
void cblas_gemv(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const INTT M, const INTT N, const T alpha, const T *A, const INTT lda, const T *X, const INTT incX, const T beta, T *Y, const INTT incY)
float cblas_dot< float >(const INTT N, const float *X, const INTT incX, const float *Y, const INTT incY)
void cblas_dcopy(const int N, const double *X, const int incX, double *Y, const int incY)
T cblas_nrm2(const INTT N, const T *X, const INTT incX)
void cblas_dgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const double alpha, const double *A, const int lda, const double *X, const int incX, const double beta, double *Y, const int incY)
T max_element(const std::vector< T > &v)
void cblas_sger(const enum CBLAS_ORDER Order, const int M, const int N, const float alpha, const float *X, const int incX, const float *Y, const int incY, float *A, const int lda)
void cblas_sscal(const int N, const float alpha, float *X, const int incX)
int cblas_iamax< double >(const INTT N, const double *X, const INTT incX)
void cblas_ccopy(const int N, const void *X, const int incX, void *Y, const int incY)
void cblas_gemv< double >(const CBLAS_ORDER order, const CBLAS_TRANSPOSE TransA, const INTT M, const INTT N, const double alpha, const double *A, const INTT lda, const double *X, const INTT incX, const double beta, double *Y, const INTT incY)
void cblas_swap< double >(const INTT N, double *X, const INTT incX, double *Y, const INTT incY)
void cblas_dsyr(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const double alpha, const double *X, const int incX, double *A, const int lda)