8 std::ifstream myfile(file_name);
10 std::cout <<
"Unable to open file: " << file_name << std::endl;
14 if (myfile.is_open()) {
16 while ( getline (myfile,line) ) {
18 std::istringstream buf(line);
19 std::istream_iterator<std::string> beg(buf), end;
21 std::vector<std::string> tokens(beg, end);
23 if(tokens.size() != Dim) {
24 std::cout <<
"Invalid format!" << std::endl;
25 std::cout << line <<
'\n';
31 for(
int i = 0; i < Dim; i++)
32 pt(i) = atof(tokens[i].c_str());
vec_E< Vecf< N >> vec_Vecf
Vector of Eigen 1D float vector.
Definition: data_type.h:69
Defines all data types used in this lib.
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector.
Definition: data_type.h:57