21 const std::string& fileName,
bool filterDuplicates) {
23 std::vector<std::unique_ptr<TestSpacePoint> > result;
26 std::ifstream spFile(fileName);
27 if (!spFile.is_open()) {
28 throw std::runtime_error(
"Could not open file: " + fileName);
33 std::size_t duplicatesFound = 0;
34 while (!spFile.eof()) {
37 std::stringstream ss(line);
41 if (linetype !=
"lxyz") {
46 float x,
y,
z, varianceR, varianceZ;
47 ss >> layer >> x >> y >> z >> varianceR >> varianceZ;
48 const float r = std::sqrt(x * x + y * y);
49 const float f22 = varianceR;
50 const float wid = varianceZ;
51 float cov = wid * wid * .08333;
65 std::unique_ptr<TestSpacePoint> sp(
69 if (filterDuplicates) {
70 bool discardSP =
false;
71 for (
const auto& otherSP : result) {
72 if (*sp == *otherSP) {
84 result.push_back(std::move(sp));
87 if (duplicatesFound) {
88 std::cerr << duplicatesFound <<
" duplicates found in: " << fileName