Reading in data from file in certain format
I have a text file (output of another program, Mathematica) containing the complex values of some function:
I could rewrite this in some conveinient way if any is better, but basically it boils down to a function of two variables that is complex valued.
f[0, 6] = 0.00006639570. - 6.00456*I;
f[1, 6] = 0.00003602 +0.0039842775.*I;
f[0, 7] = 0.0000663- 6.00383226386*I;
f[1, 7] = 60233709 + 0.00039842*I;
I want to read this into to some c++ code then perhaps store it in some vector/map/hash structure that will easily let me access the complex value given the point in parameter space (x,y).
I'm able to rewrite the format on the input file anyway you like, e.g.
entries could look like x, y, cvalue or whatever is best.
I was thinking of possible storing this in a structure like map, where the key is a pair of doubles, and the value is a complex number, would this be the best way? Then how do I do this inputting?