MCPcopy Create free account
hub / github.com/I-Rinka/BIT-Compile-Principle / Multiply

Function Multiply

Lab2/src/Matrix_Operation.c:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5}
6
7int *Multiply(int *matrix1, int *matrix2, int size)
8{
9 int *ans = (int *)calloc(sizeof(int), size * size);
10 for (int i = 0; i < size; i++)
11 {
12 for (int j = 0; j < size; j++)
13 {
14 int temp = 0;
15 for (int n = 0; n < size; n++)
16 {
17 temp += *GetPoint(matrix1, size, i, n) * (*GetPoint(matrix2, size, n, j));
18 }
19 *GetPoint(ans, size, i, j) = temp;
20 }
21 }
22 return ans;
23}

Callers 1

mainFunction · 0.70

Calls 1

GetPointFunction · 0.70

Tested by

no test coverage detected