MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / operator +

Method operator +

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

Source from the content-addressed store, hash-verified

10 cols(other.cols), cnt(other.cnt), data(other.data) { }
11 T& operator()(int i, int j) { return at(i, j); }
12 matrix<T> operator +(const matrix& other) {
13 matrix<T> res(*this); rep(i,0,cnt)
14 res.data[i] += other.data[i]; return res; }
15 matrix<T> operator -(const matrix& other) {
16 matrix<T> res(*this); rep(i,0,cnt)
17 res.data[i] -= other.data[i]; return res; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected