summaryrefslogtreecommitdiff
path: root/src/common/include/gudhi/Points_fvecs_reader.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-12 09:05:25 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-10-12 09:05:25 +0000
commit4e11105c6ab550f664699fc25b71d06884fa2bd3 (patch)
treeea66bd7d90edad6edbcb2f4c47b67178a018cc00 /src/common/include/gudhi/Points_fvecs_reader.h
parenta6ba309f1995700369e6b7b2c38f10ce0f9fd010 (diff)
parentf1d0acdc9f3f8d886996cc078242b48598a3275a (diff)
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/toplex_map@3946 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 213c7b76c5f8c3248b24a2ac9250ed59034d8076
Diffstat (limited to 'src/common/include/gudhi/Points_fvecs_reader.h')
-rw-r--r--src/common/include/gudhi/Points_fvecs_reader.h68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/common/include/gudhi/Points_fvecs_reader.h b/src/common/include/gudhi/Points_fvecs_reader.h
deleted file mode 100644
index eb03bb72..00000000
--- a/src/common/include/gudhi/Points_fvecs_reader.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
- * Author(s): Vincent Rouvreau
- *
- * Copyright (C) 2015 INRIA Saclay (France)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef POINTS_FVECS_READER_H_
-#define POINTS_FVECS_READER_H_
-
-namespace Gudhi {
-
-template<typename Kernel, typename OutputIteratorPoints>
-bool load_points_from_fvecs_file(const std::string &filename, OutputIteratorPoints points, int only_the_first_n_points = -1)
-{
- typedef typename Kernel::Point_d Point;
-
- std::ifstream in(filename, std::ios::binary);
- if (!in.is_open()) {
- std::cerr << "Could not open '" << filename << "'" << std::endl;
- return false;
- }
-
- Kernel k;
- unsigned long pt_dim = 0;
-
- in.read(reinterpret_cast<char*>(&pt_dim), 4);
- std::vector<float> current_pt;
- current_pt.reserve(pt_dim);
- for (int c = 0; !in.fail() && c != only_the_first_n_points; ++c) {
-
- for (int j = 0; j < pt_dim; ++j)
- {
- float coord = 0.f;
- in.read(reinterpret_cast<char*>(&coord), 4);
- current_pt.push_back(coord);
- }
-
- *points++ = Point(current_pt.begin(), current_pt.end());
- current_pt.clear();
- in.read(reinterpret_cast<char*>(&pt_dim), 4);
- }
-
-#ifdef DEBUG_TRACES
- std::cerr << "'" << filename << "' loaded." << std::endl;
-#endif
-
- return true;
-}
-
-
-} // namespace Gudhi
-
-#endif // POINTS_FVECS_READER_H_