MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / getElement

Method getElement

week13/examples/matclass.cpp:25–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 bool setElement(size_t r, size_t c, int value);
24};
25int IntMat::getElement(size_t r, size_t c)
26{
27 if ( r >= this->rows || c >= this->cols)
28 {
29 cerr << "Indices are out of range" << endl;
30 return 0;
31 }
32 return data[ this->cols * r + c];
33}
34bool IntMat::setElement(size_t r, size_t c, int value)
35{
36 if ( r >= this->rows || c >= this->cols)

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected