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

Function main

Lab1/C/src/Matrix_Multiply.c:28–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 return ans;
27}
28int main()
29{
30 size = 1000;
31 int *matrix1 = (int *)calloc(sizeof(int), size * size);
32 int *matrix2 = (int *)calloc(sizeof(int), size * size);
33
34 for (int i = 0; i < size; i++)
35 {
36 for (int j = 0; j < size; j++)
37 {
38 *GetPoint(matrix1, i, j) = i + 1;
39 *GetPoint(matrix2, i, j) = i + 1;
40 }
41 }
42
43 int *ans = Multiply(matrix1, matrix2);
44
45 for (int i = 0; i < size; i++)
46 {
47 for (int j = 0; j < size; j++)
48 {
49 printf("%d,", *GetPoint(ans, i, j));
50 }
51 printf("\n");
52 }
53 free(matrix1);
54 free(matrix2);
55 free(ans);
56
57 return 0;
58}

Callers

nothing calls this directly

Calls 2

GetPointFunction · 0.70
MultiplyFunction · 0.70

Tested by

no test coverage detected