I am having problems dividing and multiplying matrix multiplication by work. From what I understand, you split the matrices of size nxn into quadrants (each quadrant is n / 2), and then you do:
C11 = A11β
B11 + A12 β
B21 C12 = A11β
B12 + A12 β
B22 C21 = A21 β
B11 + A22 β
B21 C22 = A21 β
B12 + A22 β
B22
My conclusion for divide and conquer is really great, and I had trouble figuring out the problem, as I am not very good at recursion.
Output Example:
Original matrix A:
4 0 4 3 5 4 0 4 4 0 4 0 4 1 1 1
A x A
Classic:
44 3 35 15 56 20 24 35 32 0 32 12 29 5 21 17
Divide and conquer:
992 24 632 408 1600 272 720 1232 512 0 512 384 460 17 405 497
Can someone tell me what I am doing wrong to divide and win? All my matrices are int[][] , and the classic method is the traditional three-dimensional matrix multiplication
math algorithm matrix multiplication
Raptrex
source share