I am doing an iterative calculation on a streaming network, during which I need to record how much each source contributes to the flow on each edge. The flow at any one edge is determined by an average of 2% of the sources, so I define vector< map<int, double> > flow , where flow[e][s] = f means that the flow to the edge e due to the source s is f . At each iteration, each f in flow updated.
Using peak program memory approaches 4 GB. This works on (32-bit) Linux and OS X, but it crashes on Windows (which apparently imposes 2 GB on each process ).
How can I implement a data structure on a disk with the interface vector< map<int, double> > (or else get around this problem)?
source share