23 #if defined(DEBUG) && defined(DEBUG_PORT)
39 #define MATRIX_ELEMENT(MAT, i, j, rows, cols) *(MAT + i*cols + j)
76 pmat =
new float*[this->
rows];
77 for (i = 1, *pmat = this->
mat; i < this->
rows; i++)
78 *(pmat + i) = *(pmat + i - 1) + this->
cols;
81 size_t rc = this->rows * this->
cols;
82 for (i = 0; i < rc; i++)
83 this->
mat[i] = initVal;
85 #ifdef MATRIX_OBJ_DEBUG
92 #ifdef MATRIX_OBJ_DEBUG
97 void PrintToDebug(
size_t decimals = 2)
105 for (i = 0; i < this->
rows; i++)
108 for (j = 0; j < this->
cols; j++)
111 DEBUG_PORT.print((j != this->cols - 1) ?
", " :
"");
131 #ifdef MATRIX_OBJ_DEBUG
A matrix object is definied by it's rows and columns.
Definition: matrices.h:53
float * mat
Definition: matrices.h:123
size_t cols
Definition: matrices.h:122
size_t rows
Definition: matrices.h:121
~Matrix()
Definition: matrices.h:127
Matrix(size_t rows=3, size_t cols=3)
Define a matrix by rows and columns.
Definition: matrices.h:65
#define DEBUG_PORT
Definition: debugging.h:37
#define MATRIX_ELEMENT(MAT, i, j, rows, cols)
A matrix object is definied by it's rows and columns.
Definition: matrices.h:39