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

Method pow

Math/Freivalds Algorithm.cpp:50–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 return ans;
49 }
50 inline Mat pow(long long k) {
51 assert(n == m);
52 Mat ans(n, n), t = a; ans.make_unit();
53 while (k) {
54 if (k & 1) ans = ans * t;
55 t = t * t;
56 k >>= 1;
57 }
58 return ans;
59 }
60 inline Mat& operator += (const Mat& b) { return *this = (*this) + b; }
61 inline Mat& operator -= (const Mat& b) { return *this = (*this) - b; }
62 inline Mat& operator *= (const Mat& b) { return *this = (*this) * b; }

Callers

nothing calls this directly

Calls 1

make_unitMethod · 0.45

Tested by

no test coverage detected