For a math project I want to create a class to deal with matrices (two-dimensional arrays). I want to write my own class, I want it to be fast, and I don't need the matrix to be dynamical (in fact, the size is determined by the constructor and after that it will be impossible to resize it).
I wondered, would it be faster if I use a simple one-dimensional array for the matrix (i.e.: for a 4x4 Matrix I would use an array of size 16) ?
That wouldn't make any difference. In fact, there is no difference between two-dimensional arrays and one-dimensional arrys from the computers point of view: two-dimensional arrays are just a tool to make things easier for programmers.
there will be only problem with memory, because in two dimensional array you have length 16, but in one dimensional array you need extra memory for count of columns or rows.