| 47 | |
| 48 | |
| 49 | matrix Mul(const matrix& A,const matrix& B) |
| 50 | { |
| 51 | unsigned int m=A.size(),n=B[0].size(),t=A[0].size(); |
| 52 | if (t!=B.size()) { throw invalid_length(); } |
| 53 | matrix C(m, vector<bigint>(n) ); |
| 54 | for (unsigned int i=0; i<m; i++) |
| 55 | { for (unsigned int j=0; j<n; j++) |
| 56 | { C[i][j]=0; |
| 57 | for (unsigned int k=0; k<t; k++) |
| 58 | { C[i][j]+=A[i][k]*B[k][j]; } |
| 59 | } |
| 60 | } |
| 61 | return C; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | /* Uses Algorithm 2.7 from Pohst-Zassenhaus to compute H and U st |
no test coverage detected