MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / matrix

Method matrix

code/data-structures/matrix.cpp:7–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 int rows, cols, cnt; vector<T> data;
6 inline T& at(int i, int j) { return data[i * cols + j]; }
7 matrix(int r, int c) : rows(r), cols(c), cnt(r * c) {
8 data.assign(cnt, T(0)); }
9 matrix(const matrix& other) : rows(other.rows),
10 cols(other.cols), cnt(other.cnt), data(other.data) { }
11 T& operator()(int i, int j) { return at(i, j); }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected