Permalink
Browse files

bug fix for matrix_multiply w/o LAPACK

  • Loading branch information...
mazumdarparijat committed Jul 24, 2014
1 parent f764629 commit 1b8d0fcfc23c15c6e7489e24db4f2448cba6b263
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/shogun/lib/SGMatrix.cpp
@@ -929,12 +929,19 @@ SGMatrix<float64_t> SGMatrix<T>::matrix_multiply(
A.matrix, A.num_rows, B.matrix, B.num_rows,
0.0, C.matrix, C.num_rows);
#else
/* C(i,j) = scale * \Sigma A(i,k)*B(k,j) */
for (int32_t i=0; i<rows_A; i++)
{
for (int32_t j=0; j<cols_B; j++)
{
for (int32_t k=0; k<cols_A; k++)
C(i,j) += A(i,k)*B(k,j);
{
float64_t x1=transpose_A ? A(k,i):A(i,k);
float64_t x2=transpose_B ? B(j,k):B(k,j);
C(i,j)+=x1*x2;
}
C(i,j)*=scale;
}
}
#endif //HAVE_LAPACK

0 comments on commit 1b8d0fc

Please sign in to comment.