8 if (_rows == 0 || _columns == 0)
10 throw std::runtime_error(
"A matrix creation requires the number of rows and columns to be larger than zero.");
12 _numberOfEntries = _rows * _columns;
13 _matrix =
static_cast<T*
>(_aligned_malloc(_numberOfEntries *
sizeof(T),_defaultAlignment));
16 _rowStepWidth = _columns;
22 _columnStepWidth = _rows;
29 _aligned_free(_matrix);
36 int64_t index = row * _rowStepWidth + column * _columnStepWidth;
37 return _matrix[index];
43 int64_t index = row * _rowStepWidth + column * _columnStepWidth;
44 _matrix[index] =
value;
bsoncxx::types::value value
Definition DocumentManager.h:16
Access optimized dense matrix handle.
void SetValue(int64_t row, int64_t column, T &value)
Definition Matrix.hpp:41
T GetValue(int64_t row, int64_t column) const
Definition Matrix.hpp:34
int64_t GetNumberOfRows()
Definition Matrix.hpp:48
Matrix(int64_t rows, int64_t columns, accessOptimizationDirection direction=accessOptimizationDirection::columnWiseAccess)
Definition Matrix.hpp:6
accessOptimizationDirection
Definition Matrix.h:15
@ columnWiseAccess
Definition Matrix.h:15
int64_t GetNumberOfColumns()
Definition Matrix.hpp:54
~Matrix()
Definition Matrix.hpp:27