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

Class FloatMat

week13/examples/matclass.cpp:44–63  ·  view source on GitHub ↗

Class FloatMat

Source from the content-addressed store, hash-verified

42
43// Class FloatMat
44class FloatMat
45{
46 size_t rows;
47 size_t cols;
48 float * data;
49 public:
50 FloatMat(size_t rows, size_t cols):
51 rows(rows), cols(cols)
52 {
53 data = new float[rows * cols]{};
54 }
55 ~FloatMat()
56 {
57 delete [] data;
58 }
59 FloatMat(const FloatMat&) = delete;
60 FloatMat& operator=(const FloatMat&) = delete;
61 float getElement(size_t r, size_t c);
62 bool setElement(size_t r, size_t c, float value);
63};
64float FloatMat::getElement(size_t r, size_t c)
65{
66 if ( r >= this->rows || c >= this->cols)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected