FACT++  1.0
static std::vector<Interpolator2D::vec> Interpolator2D::ReadGrid ( const std::string &  filename)
inlinestatic

helper function to read a grid from a simple file (alternating x, y)

Parameters
filenamefilename of ascii file with data
Returns
a vector of point with the x and y values. in case of failure the vector is empty

Definition at line 310 of file Interpolator2D.h.

References Interpolator2D::vec::x, and Interpolator2D::vec::y.

Referenced by StateMachineFSC< T, S >::EvalOptions(), ReadInputGrid(), and ReadOutputGrid().

311  {
312  std::vector<Interpolator2D::vec> grid;
313 
314  std::ifstream fin(filename);
315  if (!fin.is_open())
316  return std::vector<Interpolator2D::vec>();
317 
318  while (1)
319  {
320  double x, y;
321  fin >> x;
322  fin >> y;
323  if (!fin)
324  break;
325 
326  grid.emplace_back(x, y);
327  }
328 
329  return fin.bad() ? std::vector<Interpolator2D::vec>() : grid;
330  }

+ Here is the caller graph for this function: