Skip to content

Instantly share code, notes, and snippets.

@smiler
Created November 2, 2012 07:23
Show Gist options
  • Save smiler/3999231 to your computer and use it in GitHub Desktop.
Save smiler/3999231 to your computer and use it in GitHub Desktop.
void matrix_multiply(int *A, int *B, int *C, int N)
{
for(int i=0,j=0; i<N & j<N ? 1 : j<N ? 1 +(i=0*j++) : 0; C[(i++)*N+j]=0);
for(int i=0,j=0,k=0; k++<N ? 1 : ++j<N ? k=1 : ++i<N ? k=1+(j=0) : 0;C[i*N + j] += A[i*N + k -1] * B[(k-1)*N + j]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment