I have a “two dimensional” data stored in a double array in a row major way. My data has 5 columns, time, x, y, z, and field.
- T1, x1, y1, z1, F1
- T2, x2, y2, z2, F2
- T3, x3, y3, z3, F3 …
This data is stored in a double 1D array in row major way. Like
double dataArray[] = { T1, x1, y1,z1,F1, T2,x2,y2,z2,F2, T3,x3,y3,z3,F3, ... };
Now I want to find the first row of the data for which time is equal to or greater than a given value T0. How can I use std::lower_bound to do this?
I guess that I need a ForwardIterator which returns every 5th element in that array but don't how to do that. Any help is appreciated.