numerics/src/tools/test/SBM_test.c
/* hand made gemm of nxp A matrix and pxm B matrix */
hand made gemm of nxp A matrix and pxm B matrix
hand made gemm of nxp A matrix and pxm B matrix
static void dense_gemm_by_hand(double alpha, double * A, double * B, int n, int m, int p, double beta, double *C)
{
  for(int i = 0; i < n; i++)
  {
    for(int j = 0; j < m; j++)
    {
      double sum = beta  * C[i + j * n] ;
      for(int k = 0; k < p ; k++)
      {
        sum = sum + alpha *  A[i + k * n] * B[k + j * p];
      }
      C[i + j * n] = sum;
    }
  }
}
static void dense_gemm_by_hand ( double alpha , double * A , double * B , int n , int m , int p , double beta , double * C ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { double sum = beta * C [ i + j * n ] ; for ( int k = 0 ; k < p ; k ++ ) { sum = sum + alpha * A [ i + k * n ] * B [ k + j * p ] ; } C [ i + j * n ] = sum ; } } }
hand made gemm of nxp A matrix and pxm B matrix
hand made gemm of nxp A matrix and pxm B matrix