How would you address one dimensional memory using two dimensions? (Such as getting the value Matrix::ValueAt(row, col) where Matrix stores the values as a one dimensional array (float m[16] for a 4×4 matrix).
class Matrix4x4
{
private float m[16];
float getValueAt(int row, int col)
{
// I want this function
}
}
With
m[row * 4 + col], or the other way around.