Class FloatMat
| 42 | |
| 43 | // Class FloatMat |
| 44 | class 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 | }; |
| 64 | float FloatMat::getElement(size_t r, size_t c) |
| 65 | { |
| 66 | if ( r >= this->rows || c >= this->cols) |
nothing calls this directly
no outgoing calls
no test coverage detected