I would have chosen to use a one-dimensional vector, and then index it by (row*ncols+col).
This will at least reduce memory consumption, but it may also have a significant impact on speed.
I don't remember whether a 'vector of vectors' is an endorsed idiom by the standard, but there is a risk that too much copying and memory reallocation is going on, if there is no special handling of the 'vector of vectors' case.
Not so much an answer as additional questions (these don't format well for a comment).
Observation: I think answering vector or something else better for memory storage is hard to say without knowing more about optimization potential... some of the data-related questions hit on that.
Questions about timing:
Can you modify your timing logic to read header values, then time the following scenarios:
1) Read-only, just pull each line into memory. Disable the the grid
parsing & assignment part. Goal to benchmark raw reads on file.
Also no "resize" operations on your "data" member.
2) Memory allocation (just read the headers and "resize" the "data" member;
don't loop through remainder of file).
3) Everything (code as-posted).
Seems to me that reading a file under 1gb in size will be cached by the operating system.
I'd encourage you to run the above 5 times or something and see if subsequent runs are are consistent. (If you don't check for that it might look like you get get a big speedup from a minor change to the code but actually it was just because the data file was cached by the os and your "gains" evaporate w/the next reboot).
Questions about the data file...
To paraphrase, the data file looks like a complete dump of every value in the grid.
Example: In addition to the 6 "header" lines, a 100 x 200 "grid" will have 100 lines in the file with 200 lines on each row. So 6 + 100*200 = 20,006 lines.
You mentioned a 900 MB data file.
I'll make some assumptions, just for the fun of it.
If your values are consistently formatted (e.g. "0.000000" thru "1.000000") that means 8 chars per value.
Assuming simple encoding (1 byte per character) then you'll fit something like a 10,000^2 grid in 900 MB.
Ignoring the header "lines" and end-of-line delims (which will just be rounding errors):
1kb has 1,024 char