Add support for Matrix properties

This commit is contained in:
2023-01-30 18:27:22 +01:00
parent ed7e2c1a78
commit 024f770ee0
3 changed files with 105 additions and 7 deletions
+10 -3
View File
@@ -251,9 +251,16 @@ struct Complex64
template<typename T>
class Matrix
{
int width;
int height;
std::vector<T> elem;
int _rows = 0;
int _cols = 0;
std::vector<T> _elem;
public:
Matrix() = default;
Matrix(int rows, int cols) : _rows(rows), _cols(cols), _elem(rows * cols) {}
void resize(int rows, int cols) { _rows = rows; _cols = cols; _elem.resize(rows * cols); }
T& operator()(int row, int col) { return _elem[row * _cols + col]; }
friend class MatrixConvert;
};
typedef bool Boolean;