// (A_1,1 + A_2,2)*(B_1,1 + B_2,1) void* calcM1(void* nothing) { double **temp1, **temp2; temp1 = allocMatrix(perfectMatrix / 2); temp2 = allocMatrix(perfectMatrix / 2); simpleAdd(A11, A22, temp1, perfectMatrix / 2); simpleAdd(A11, A22, temp2, perfectMatrix / 2); simpleMM(temp1, temp2, M1, perfectMatrix / 2); free(temp1); free(temp2); return 0; }
// (A_1,1 + A_2,2)*(B_1,1 + B_2,1) void* calcM1(void* nothing) { int **temp1; int **temp2; temp1 = allocMatrix(N/2); temp2 = allocMatrix(N/2); simpleAdd(A11, A22, temp1, N/2); simpleAdd(A11, A22, temp2, N/2); simpleMM(temp1, temp2, M1, N/2); free(temp1); free(temp2); return 0; }
// (A_1,1 + A_1,2) * B_2,2 void* calcM5(void *nothing) { double **temp1; temp1 = allocMatrix(perfectMatrix / 2); simpleAdd(A11, A12, temp1, perfectMatrix / 2); simpleMM(temp1, B22, M5, perfectMatrix / 2); free(temp1); return 0; }
// (A_2,1 + A_2,2)*B_1,1 void* calcM2(void* nothing) { double **temp1; temp1 = allocMatrix(perfectMatrix / 2); simpleAdd(A21, A22, temp1, perfectMatrix / 2); simpleMM(temp1, B11, M2, perfectMatrix / 2); free(temp1); return 0; }
// (A_1,1 + A_1,2) * B_2,2 void* calcM5(void *nothing) { int **temp1; temp1 = allocMatrix(N/2); simpleAdd(A11, A12, temp1, N/2); simpleMM(temp1, B22, M5, N/2); free(temp1); return 0; }
// (A_2,1 + A_2,2)*B_1,1 void* calcM2(void* nothing) { int **temp1; temp1 = allocMatrix(N/2); simpleAdd(A21, A22, temp1, N/2); simpleMM(temp1, B11, M2, N/2); free(temp1); return 0; }
// (A_2,1 * B_1,2) + (A_2,2 * B_2,2) void* calcC22(void * nothing) { double **temp1, **temp2; temp1 = allocMatrix(perfectMatrix / 2); temp2 = allocMatrix(perfectMatrix / 2); simpleMM(A21, B12, temp1, perfectMatrix / 2); simpleMM(A22, B22, temp2, perfectMatrix / 2); simpleAdd(temp1, temp2, C22, perfectMatrix / 2); free(temp1); free(temp2); return 0; }
// (A_1,2 - A_2,2) * (B_2,1 + B_2,2) void* calcM7(void *nothing) { double **temp1, **temp2; temp1 = allocMatrix(perfectMatrix / 2); temp2 = allocMatrix(perfectMatrix / 2); simpleSub(A12, A22, temp1, perfectMatrix / 2); simpleAdd(B21, B22, temp2, perfectMatrix / 2); simpleMM(temp1, temp2, M7, perfectMatrix / 2); free(temp1); free(temp2); return 0; }
// (A_2,1 - A_1,1) * (B_1,1 + B_1,2) void* calcM6(void* nothing) { double **temp1, **temp2; temp1 = allocMatrix(perfectMatrix / 2); temp2 = allocMatrix(perfectMatrix / 2); simpleSub(A21, A11, temp1, perfectMatrix / 2); simpleAdd(B11, B12, temp2, perfectMatrix / 2); simpleMM(temp1, temp2, M6, perfectMatrix / 2); free(temp1); free(temp2); return 0; }
// (A_2,1 * B_1,2) + (A_2,2 * B_2,2) void* calcC22(void * nothing) { int **temp1; int **temp2; temp1 = allocMatrix(N/2); temp2 = allocMatrix(N/2); simpleMM(A21, B12, temp1, N/2); simpleMM(A22, B22, temp2, N/2); simpleAdd(temp1, temp2, C22, N/2); free(temp1); free(temp2); return 0; }
// (A_1,2 - A_2,2) * (B_2,1 + B_2,2) void* calcM7(void *nothing) { int **temp1; int **temp2; temp1 = allocMatrix(N/2); temp2 = allocMatrix(N/2); simpleSub(A12, A22, temp1, N/2); simpleAdd(B21, B22, temp2, N/2); simpleMM(temp1, temp2, M7, N/2); free(temp1); free(temp2); return 0; }
// (A_2,1 - A_1,1) * (B_1,1 + B_1,2) void* calcM6(void* nothing) { int **temp1; int **temp2; temp1 = allocMatrix(N/2); temp2 = allocMatrix(N/2); simpleSub(A21, A11, temp1, N/2); simpleAdd(B11, B12, temp2, N/2); simpleMM(temp1, temp2, M6, N/2); free(temp1); free(temp2); return 0; }