Hello.
There is a question: how can I best save the table - right in the code or in the file from which it will be loaded, if the table has the following format:

1 2 3 4 5 1 2 3 4 5 

Instead of numbers there will be names, and the fields will be filled with percentages.
108 by 108 cells, will not change.
Thanks in advance for your reply.

    1 answer 1

    1. In the code to store, if immutable data is assumed, then you can create a constant array of arrays (array of arrays, array of vectors, array vector, vector of vectors, meps, etc. - then just an array).
    2. If the data must be actively and frequently changed, but not saved, then you can keep it in a nonconstant array and, for example, change each “cell” in a separate stream (I don’t know what the task is there).
    3. If you need to frequently change and save, load from a file or database into an array, change there and save again.
    4. If you rarely need to change and save, then you can directly save each cell each time you change it and load everything from the file / DB if you need to display (if it really is 5 by 5, then you can).

    Whatever the task, other options are hard to imagine.


    PS In general, it would be better to describe the task in more detail.

    • Refined a little, I confess. Just 108 to 108 array to declare immediately filled with expensive. If you load - what to store? - LowSkiII
    • one
      if you need random access to each cell at boot, then in any database, it does not matter. The format, for example, can be (in the database): row number, column number, value (or for each column its own field in the database, if the “meaning” of these columns is heterogeneous, but I understand it is a kind of matrix where everything cells have the same data type?). If you just need to consistently read everything, then in any format in the file: binary, xml ... It is possible that in the database, if convenient - asianirish