summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex/example
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-14 12:59:53 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-14 12:59:53 +0000
commit5389d8969d8386bb4c74dbef4b7c7992e9130f13 (patch)
tree25864562808aa410483b482b1944efcbcb6e43b7 /src/Bitmap_cubical_complex/example
parentff41ff166c9ea66fcc1187056053e43bf7d7be8f (diff)
Answers to Marc's comments.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bitmap@1042 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 481841d609bae68df85a93527e6d3cc20f1b06e2
Diffstat (limited to 'src/Bitmap_cubical_complex/example')
-rw-r--r--src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp146
-rw-r--r--src/Bitmap_cubical_complex/example/CMakeLists.txt4
2 files changed, 75 insertions, 75 deletions
diff --git a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
index 39a55f24..4c30ee85 100644
--- a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
+++ b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp
@@ -1,73 +1,73 @@
- /* 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): Pawel Dlotko
- *
- * 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/>.
- */
-
-
-#include <gudhi/reader_utils.h>
-#include <gudhi/Bitmap_cubical_complex.h>
-#include <gudhi/Persistent_cohomology.h>
-
-
-using namespace Gudhi;
-using namespace Gudhi::Cubical_complex;
-using namespace Gudhi::persistent_cohomology;
-
-//standard stuff
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- cout << "This program computes persistent homology, by using bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style (the only numbered in \
-the first line is a dimension D of a bitmap. In the lines I between 2 and D+1 there are numbers of top dimensional cells in the direction I. Let N denote product \
-of the numbers in the lines between 2 and D. In the lines D+2 to D+2+N there are filtrations of top dimensional cells. We assume that the cells are in the \
-lexicographical order. See CubicalOneSphere.txt or CubicalTwoSphere.txt for example." << endl;
-
- int p = 2;
- double min_persistence = 0;
-
- if ( argc != 2 )
- {
- cout << "Wrong number of parameters. Please provide the name of a file with a Perseus style bitmap at the input. The program will now terminate.\n";
- return 1;
- }
-
- Bitmap_cubical_complex< Bitmap_cubical_complex_base<double> > b( argv[1] );
-
-
- // Compute the persistence diagram of the complex
- persistent_cohomology::Persistent_cohomology< Bitmap_cubical_complex< Bitmap_cubical_complex_base<double> >, Field_Zp > pcoh(b);
- pcoh.init_coefficients( p ); //initilizes the coefficient field for homology
- pcoh.compute_persistent_cohomology( min_persistence );
-
-
- stringstream ss;
- ss << argv[1] << "_persistence";
- std::ofstream out((char*)ss.str().c_str());
- pcoh.output_diagram(out);
- out.close();
-
- return 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): Pawel Dlotko
+ *
+ * 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/>.
+ */
+
+
+#include <gudhi/reader_utils.h>
+#include <gudhi/Bitmap_cubical_complex_base.h>
+#include <gudhi/Bitmap_cubical_complex.h>
+#include <gudhi/Persistent_cohomology.h>
+
+
+using namespace Gudhi;
+using namespace Gudhi::Cubical_complex;
+using namespace Gudhi::persistent_cohomology;
+
+//standard stuff
+#include <iostream>
+#include <sstream>
+#include <vector>
+
+using namespace std;
+
+
+int main( int argc , char** argv )
+{
+ cout << "This program computes persistent homology, by using bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style (the only numbered in \
+the first line is a dimension D of a bitmap. In the lines I between 2 and D+1 there are numbers of top dimensional cells in the direction I. Let N denote product \
+of the numbers in the lines between 2 and D. In the lines D+2 to D+2+N there are filtrations of top dimensional cells. We assume that the cells are in the \
+lexicographical order. See CubicalOneSphere.txt or CubicalTwoSphere.txt for example." << endl;
+
+ int p = 2;
+ double min_persistence = 0;
+
+ if ( argc != 2 )
+ {
+ cout << "Wrong number of parameters. Please provide the name of a file with a Perseus style bitmap at the input. The program will now terminate.\n";
+ return 1;
+ }
+
+ Bitmap_cubical_complex< Bitmap_cubical_complex_base<double> > b( argv[1] );
+
+ // Compute the persistence diagram of the complex
+ persistent_cohomology::Persistent_cohomology< Bitmap_cubical_complex< Bitmap_cubical_complex_base<double> >, Field_Zp > pcoh(b);
+ pcoh.init_coefficients( p ); //initilizes the coefficient field for homology
+
+ pcoh.compute_persistent_cohomology( min_persistence );
+
+ stringstream ss;
+ ss << argv[1] << "_persistence";
+ std::ofstream out((char*)ss.str().c_str());
+ pcoh.output_diagram(out);
+ out.close();
+
+ return 0;
+}
diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt
index fbd1b28b..14c94e8e 100644
--- a/src/Bitmap_cubical_complex/example/CMakeLists.txt
+++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt
@@ -13,5 +13,5 @@ add_test(Random_bitmap_cubical_complex ${CMAKE_CURRENT_BINARY_DIR}/Random_bitmap
add_executable ( Bitmap_cubical_complex_periodic_boundary_conditions Bitmap_cubical_complex_periodic_boundary_conditions.cpp )
target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${Boost_SYSTEM_LIBRARY})
-add_executable ( Compute_persistence_with_phat Compute_persistence_with_phat.cpp )
-target_link_libraries(Compute_persistence_with_phat ${Boost_SYSTEM_LIBRARY}) \ No newline at end of file
+#add_executable ( Compute_persistence_with_phat Compute_persistence_with_phat.cpp )
+#target_link_libraries(Compute_persistence_with_phat ${Boost_SYSTEM_LIBRARY}) \ No newline at end of file