矩阵乘法法则证明(矩阵乘法法则)

导读 A(n(长), m(宽))* B(m, p) = C(n, m)c[i][j] = Σ a[i][k] * b[k][j] (1

A(n(长), m(宽))* B(m, p) = C(n, m)c[i][j] = Σ a[i][k] * b[k][j] (1 <= k <= m)函数:Matrix multi(Matrix a, Matrix b){Matrix ans;ans.n = a.n;ans.m = b.m;memset(ans.num, 0, sizeof(ans.num));for (int i = 0; i < a.n; i ++)for (int j = 0; j < b.m; j ++)for (int k = 0; k < b.n; k ++)ans.num[i][j] += a.num[i][k] * b.num[k][j];return ans;}。

免责声明:本文由用户上传,如有侵权请联系删除!