OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
FromFile.cpp
Go to the documentation of this file.
1 #include "Expression/FromFile.h"
2 
5 
6  values_.clear();
7 
8  std::ifstream file;
9  file.open(filename_.c_str(), std::ios::in);
10  if(!file) {
11  throw OptPilotException("FromFile::readValues()",
12  "Error opening file " + filename_);
13  }
14 
15  std::copy(std::istream_iterator<double>(file),
16  std::istream_iterator<double>(),
17  std::back_inserter(values_));
18 
19  file.close();
20 }
21 
void readValues()
reads a simple list of double values
Definition: FromFile.cpp:4
std::vector< double > values_
Definition: FromFile.h:57
std::string filename_
Definition: FromFile.h:59