2 ms·
If you want to do make an implementation that supports runtime-specified matrix sizes you change your implementation from... auto *my_matrix = new MathArra
by gravypod 9y ago
If you want to do make an implementation that supports runtime-specified matrix sizes you change your implementation from...
auto *my_matrix = new MathArray<double, 10, 10>();
Into
auto *my_matrix = new MathArray<double>(10, 10);
Most programs don't need dynamically sized arrays (rows and columns) and as such it makes sense to also provide a template Row and Column width. By doing this you can likely implement matrix multiplication and addition as a constexpr (with some effort) and thus get....
1. Compile time matrix evaluation
2. Vectorized multiplication/addition of matrices
3. Pipline-efficient code