• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版ba31ce6dc54d3ccbee39f1fae5413eec07c13712 (tree)
时间2013-01-24 22:41:40
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Add the argument that indicates whether the matrix is row/column-major to Dsyrk. #30562

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1251 1136aad2-a195-0410-b898-f5ea1d11b9d8

更改概述

差异

--- a/src/wrappers/Blas.cpp
+++ b/src/wrappers/Blas.cpp
@@ -313,7 +313,7 @@ void Blas::Dsyrk(molds_blas_int n, molds_blas_int k,
313313 bool isMatrixATransposed = false;
314314 bool isLowerTriangularPartMatrixCUsed = false;
315315 double alpha = 1.0 , beta = 0.0;
316- this->Dsyrk(n, k, isMatrixATransposed, isLowerTriangularPartMatrixCUsed, alpha, matrixA, beta, matrixC);
316+ this->Dsyrk(n, k, isMatrixAColumnMajor, isMatrixATransposed, isLowerTriangularPartMatrixCUsed, alpha, matrixA, beta, matrixC);
317317 }
318318
319319 // matrixC = alpha*matrixA*matrixA^T + beta*matrixC (isMatrixATransposed==false)
@@ -322,17 +322,19 @@ void Blas::Dsyrk(molds_blas_int n, molds_blas_int k,
322322 // matrixA: n*k-matrix (isMatrixATransposed==false) or k*n-matrix (isMatrixATransposed==true)
323323 // matrixC: n*n-matrix,symmetric (Use the upper triangular part, and copy it to the lower part.)
324324 void Blas::Dsyrk(molds_blas_int n, molds_blas_int k,
325+ bool isMatrixAColumnMajor,
325326 bool isMatrixATransposed,
326327 bool isLowerTriangularPartMatrixCUsed,
327328 double alpha, double const* const* matrixA,
328329 double beta, double ** matrixC)const{
329330 double* c = &matrixC[0][0];
330331 double* a = const_cast<double*>(&matrixA[0][0]);
332+ CBLAS_ORDER orderA = isMatrixAColumnMajor ? CblasColMajor : CblasRowMajor;
331333 CBLAS_UPLO uploC= isLowerTriangularPartMatrixCUsed ? CblasLower : CblasUpper;
332334 CBLAS_TRANSPOSE transA= isMatrixATransposed ? CblasTrans : CblasNoTrans;
333335 molds_blas_int lda = &matrixA[1][0] - &matrixA[0][0];
334336 molds_blas_int ldc = &matrixC[1][0] - &matrixC[0][0];
335- cblas_dsyrk(CblasRowMajor, uploC, transA, n, k, alpha, a, lda, beta, c, ldc);
337+ cblas_dsyrk(orderA, uploC, transA, n, k, alpha, a, lda, beta, c, ldc);
336338 #pragma omp parallel for schedule(auto)
337339 for(molds_blas_int i=0;i<n;i++){
338340 for(molds_blas_int j=i+1;j<n;j++){
--- a/src/wrappers/Blas.h
+++ b/src/wrappers/Blas.h
@@ -89,6 +89,7 @@ public:
8989 double const *const* matrixA,
9090 double** matrixC)const;
9191 void Dsyrk(molds_blas_int n, molds_blas_int k,
92+ bool isMatrixAColumnMajor,
9293 bool isMatrixATransposed,
9394 bool isLowerTriangularPartMatrixCUsed,
9495 double alpha, double const* const* matrixA,