MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / make_unit

Method make_unit

Math/Freivalds Algorithm.cpp:12–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 Mat(int _n, int _m) {n = _n; m = _m; a.assign(n, vector<int>(m, 0)); }
11 Mat(vector< vector<int> > v) { n = v.size(); m = n ? v[0].size() : 0; a = v; }
12 inline void make_unit() {
13 assert(n == m);
14 for (int i = 0; i < n; i++) {
15 for (int j = 0; j < n; j++) a[i][j] = i == j;
16 }
17 }
18 inline Mat operator + (const Mat &b) {
19 assert(n == b.n && m == b.m);
20 Mat ans = Mat(n, m);

Callers 1

powMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected