daylight-library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub daylight-pro/daylight-library

:heavy_check_mark: daylight/math/matrix.hpp

Depends on

Verified with

Code

#include "daylight/base.hpp"
template<typename T>
vector<vector<T>> multiMatrix(const vector<vector<T>> &A,
							  const vector<vector<T>> &B) {
	int N = SZ(A);
	int M = SZ(B[0]);
	int L = SZ(A[0]);
	auto ret = make_v<T>(N, M);
	REP(i, N) {
		REP(j, M) {
			REP(k, L) {
				ret[i][j] += A[i][k] * B[k][j];
			}
		}
	}
	return ret;
}

template<typename T>
vector<vector<T>> powMatrix(const vector<vector<T>> &A,
							ll p) {
	auto ans = make_v<T>(SZ(A), SZ(A));
	REP(i, SZ(A)) ans[i][i] = 1;
	auto mul = A;
	for(; p > 0; p >>= 1) {
		if((p & 1) == 1) ans = multiMatrix(ans, mul);
		mul = multiMatrix(mul, mul);
	}
	return ans;
}
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
    bundled_code = language.bundle(path, basedir=basedir)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 482, in update
    self.update(
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 477, in update
    raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: daylight/base.hpp: line 103: unable to process #include in #if / #ifdef / #ifndef other than include guards
Back to top page