If I'm creating a matrix of indicators, is it better to use rows or columns as the indicator with length barcount-1 and why?
When I've created matricies where one dimension is number of bars, I've used the rows as BarCount - 1
purely because it's the most comfortable mental model for me.
Practically speaking, there is a transpose function if you needed to have it another way for whatever reason.
It doesn't affect how I assign things with MxCopy which takes in the dimension of the blocks you want to copy, and it doesn't affect how I get data out of the matrix because you either iterate through the row mx[enumColumnId][i]
or the column mx[i][enumRowId]
.
What I've found is that dictionaries are much easier to understand if I'm just looking for general storage devices so I wrote my own dictionary library using VarGet/Set and moved away from matricies.
Generally speaking I would worry about this too much. Technically you would be accessing memory sequentially if you iterated by column index first so the answer to your question would be "use columns" as it might give slight performance advantage, but as long as matrix is small enough to fit in processor cache, it does not matter that much.
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.