comparison c/utils.cpp @ 153:c8a149fccfda

corrected bug in reading floats from text files
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 06 Sep 2011 19:22:24 -0400
parents 7bf8084e720f
children bc4ea09b1743
comparison
equal deleted inserted replaced
152:74b1fc68d4df 153:c8a149fccfda
17 string line = ::getlineComment(in); 17 string line = ::getlineComment(in);
18 vector<string> tokens; 18 vector<string> tokens;
19 ::split(tokens, line, separator); 19 ::split(tokens, line, separator);
20 vector<float> numbers; 20 vector<float> numbers;
21 BOOST_FOREACH(string s, tokens) 21 BOOST_FOREACH(string s, tokens)
22 numbers.push_back(::toInt(s)); 22 numbers.push_back(::toFloat(s));
23 if (!numbers.empty()) 23 if (!numbers.empty())
24 result.push_back(numbers); 24 result.push_back(numbers);
25 } 25 }
26 } 26 }
27 27