Last active
March 31, 2016 05:21
-
-
Save stevester94/547de4ad532a397e33cb6bd322f3dd7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| double** multiplyMatrices(double** A, int Am, int An, double** B, int Bm, int Bn) { | |
| int i, j, k, l; | |
| double** retAr = create2DDoubleArray(Am, Bn); | |
| if(An != Bm) { | |
| printf("OH FUCK YO\n"); | |
| return NULL; | |
| } | |
| for(i = 0; i < Am; i++) { | |
| for(j = 0; j < Bn; j++) { | |
| for(k = 0; k < An; k++) { | |
| //printf("%d, %d, %d\n", i,j,k); | |
| retAr[i][j] += A[i][k] * B[k][j]; | |
| } | |
| } | |
| } | |
| return retAr; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment