I am writing a program for numerical modeling in C. Part of the modeling is spatially fixed nodes that have some float value with each other node. It looks like a directed graph. However, if two nodes are too far away (than some cutoff length a), this value is 0.
To represent all of these “correlations” or floating point values, I tried using a 2D array, but since I have 100,000 or more nodes, this will correspond to 40 GB or so.
Now I am trying to think of different issues for this issue. I do not want to save all these values on the hard drive. I also do not want to count them on the fly. One idea was some kind of sparse matrix, such as the one that can be used in Matlab.
Do you have any other ideas on how to store these values?
I am new to C, so please do not expect too much experience.
Thanks and best regards, Jan Oliver
source
share