summaryrefslogtreecommitdiff
path: root/src/Gudhi_stat/example/utilities/persistence_intervals
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gudhi_stat/example/utilities/persistence_intervals')
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/aaa51
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/aaa_Gnuplot_script208
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp72
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp57
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp69
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp93
-rw-r--r--src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_intervals.cpp59
7 files changed, 0 insertions, 609 deletions
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/aaa b/src/Gudhi_stat/example/utilities/persistence_intervals/aaa
deleted file mode 100644
index 5aed2ec0..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/aaa
+++ /dev/null
@@ -1,51 +0,0 @@
-0.254583 0.837489
-0.25491 0.410985
-0.262238 0.405964
-0.233498 0.338685
-0.253282 0.344571
-0.249923 0.339748
-0.179532 0.263873
-0.247402 0.323782
-0.181315 0.249492
-0.160746 0.22547
-0.170367 0.232149
-0.192048 0.253065
-0.27298 0.333994
-0.202383 0.260308
-0.278325 0.329157
-0.176624 0.226215
-0.200184 0.249281
-0.275607 0.323516
-0.178408 0.224032
-0.319435 0.362706
-0.184347 0.226301
-0.19342 0.23356
-0.143554 0.180648
-0.313975 0.34917
-0.260887 0.29465
-0.206395 0.23344
-0.272846 0.298156
-0.222294 0.246925
-0.272951 0.295696
-0.235421 0.257957
-0.277907 0.29913
-0.16591 0.186925
-0.223042 0.243167
-0.435025 0.454885
-0.151992 0.169807
-0.138011 0.155776
-0.218083 0.235837
-0.219364 0.237079
-0.297063 0.313899
-0.282666 0.298727
-0.24199 0.256381
-0.302722 0.316677
-0.160453 0.174076
-0.157689 0.169984
-0.192957 0.204705
-0.153738 0.165306
-0.226448 0.237898
-0.243627 0.252613
-0.210126 0.21907
-0.172082 0.177708
-0.232291 0.234521
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/aaa_Gnuplot_script b/src/Gudhi_stat/example/utilities/persistence_intervals/aaa_Gnuplot_script
deleted file mode 100644
index 3ff83e9c..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/aaa_Gnuplot_script
+++ /dev/null
@@ -1,208 +0,0 @@
-set xrange [0.131016 : 0.844554]
-set yrange [0 : 16.16]
-plot '-' using 1:2 notitle with lp
-0.138011 0
-0.138011 1
-0.143554 1
-0.143554 2
-0.151992 2
-0.151992 3
-0.153738 3
-0.153738 4
-0.155776 4
-0.155776 3
-0.157689 3
-0.157689 4
-0.160453 4
-0.160453 5
-0.160746 5
-0.160746 6
-0.165306 6
-0.165306 5
-0.16591 5
-0.16591 6
-0.169807 6
-0.169807 5
-0.169984 5
-0.169984 4
-0.170367 4
-0.170367 5
-0.172082 5
-0.172082 6
-0.174076 6
-0.174076 5
-0.176624 5
-0.176624 6
-0.177708 6
-0.177708 5
-0.178408 5
-0.178408 6
-0.179532 6
-0.179532 7
-0.180648 7
-0.180648 6
-0.181315 6
-0.181315 7
-0.184347 7
-0.184347 8
-0.186925 8
-0.186925 7
-0.192048 7
-0.192048 8
-0.192957 8
-0.192957 9
-0.19342 9
-0.19342 10
-0.200184 10
-0.200184 11
-0.202383 11
-0.202383 12
-0.204705 12
-0.204705 11
-0.206395 11
-0.206395 12
-0.210126 12
-0.210126 13
-0.218083 13
-0.218083 14
-0.21907 14
-0.21907 13
-0.219364 13
-0.219364 14
-0.222294 14
-0.222294 15
-0.223042 15
-0.223042 16
-0.224032 16
-0.224032 15
-0.22547 15
-0.22547 14
-0.226215 14
-0.226215 13
-0.226301 13
-0.226301 12
-0.226448 12
-0.226448 13
-0.232149 13
-0.232149 12
-0.232291 12
-0.232291 13
-0.23344 13
-0.23344 12
-0.233498 12
-0.233498 13
-0.23356 13
-0.23356 12
-0.234521 12
-0.234521 11
-0.235421 11
-0.235421 12
-0.235837 12
-0.235837 11
-0.237079 11
-0.237079 10
-0.237898 10
-0.237898 9
-0.24199 9
-0.24199 10
-0.243167 10
-0.243167 9
-0.243627 9
-0.243627 10
-0.246925 10
-0.246925 9
-0.247402 9
-0.247402 10
-0.249281 10
-0.249281 9
-0.249492 9
-0.249492 8
-0.249923 8
-0.249923 9
-0.252613 9
-0.252613 8
-0.253065 8
-0.253065 7
-0.253282 7
-0.253282 8
-0.254583 8
-0.254583 9
-0.25491 9
-0.25491 10
-0.256381 10
-0.256381 9
-0.257957 9
-0.257957 8
-0.260308 8
-0.260308 7
-0.260887 7
-0.260887 8
-0.262238 8
-0.262238 9
-0.263873 9
-0.263873 8
-0.272846 8
-0.272846 9
-0.272951 9
-0.272951 10
-0.27298 10
-0.27298 11
-0.275607 11
-0.275607 12
-0.277907 12
-0.277907 13
-0.278325 13
-0.278325 14
-0.282666 14
-0.282666 15
-0.29465 15
-0.29465 14
-0.295696 14
-0.295696 13
-0.297063 13
-0.297063 14
-0.298156 14
-0.298156 13
-0.298727 13
-0.298727 12
-0.29913 12
-0.29913 11
-0.302722 11
-0.302722 12
-0.313899 12
-0.313899 11
-0.313975 11
-0.313975 12
-0.316677 12
-0.316677 11
-0.319435 11
-0.319435 12
-0.323516 12
-0.323516 11
-0.323782 11
-0.323782 10
-0.329157 10
-0.329157 9
-0.333994 9
-0.333994 8
-0.338685 8
-0.338685 7
-0.339748 7
-0.339748 6
-0.344571 6
-0.344571 5
-0.34917 5
-0.34917 4
-0.362706 4
-0.362706 3
-0.405964 3
-0.405964 2
-0.410985 2
-0.410985 1
-0.435025 1
-0.435025 2
-0.454885 2
-0.454885 1
-0.837489 1
-0.837489 0
-
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp b/src/Gudhi_stat/example/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
deleted file mode 100644
index dba0984a..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
+++ /dev/null
@@ -1,72 +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): Pawel Dlotko
- *
- * Copyright (C) 2015 INRIA Sophia-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/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/concretizations/Persistence_intervals.h>
-
-#include <iostream>
-#include <vector>
-#include <limits>
-
-
-
-using namespace Gudhi;
-using namespace Gudhi::Gudhi_stat;
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- //std::cout << "This program compute minimum birth and the maximum death time for a collection of persistence intervals \n";
- //if ( argc != 2 )
- //{
- // cout << "To run this program, please provide the name of a file with persistence diagram \n";
- // return 1;
- //}
- //Persistence_intervals p( argv[1] );
- //std::pair<double,double> min_max_ = p.min_max();
- //cout << "Birth-death range : min: " << min_max_.first << ", max: " << min_max_.second << endl;
-
- std::vector< const char* > filenames;
- for ( int i = 1 ; i < argc ; ++i )
- {
- filenames.push_back( argv[i] );
- }
-
- double min_ = std::numeric_limits<double>::max();
- double max_ = -std::numeric_limits<double>::max();
-
- for ( size_t file_no = 0 ; file_no != filenames.size() ; ++file_no )
- {
- std::cout << "Creating diagram based on a file : " << filenames[file_no] << std::endl;
- Persistence_intervals p( filenames[file_no] );
- std::pair<double,double> min_max_ = p.min_max();
- if ( min_max_.first < min_ )min_ = min_max_.first;
- if ( min_max_.second > max_ )max_ = min_max_.second;
- }
- cout << "Birth-death range : min: " << min_ << ", max: " << max_ << endl;
- return 0;
-}
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp b/src/Gudhi_stat/example/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
deleted file mode 100644
index 6e6a9c88..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
+++ /dev/null
@@ -1,57 +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): Pawel Dlotko
- *
- * Copyright (C) 2015 INRIA Sophia-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/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/concretizations/Persistence_intervals.h>
-
-#include <iostream>
-
-
-
-using namespace Gudhi;
-using namespace Gudhi::Gudhi_stat;
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- std::cout << "This program compute the dominant intervals. A number of intervals to be displayed is a parameter of this program. \n";
- if ( argc != 3 )
- {
- cout << "To run this program, please provide the name of a file with persistence diagram and number of dominant intervals you would like to get \n";
- return 1;
- }
-
- Persistence_intervals p( argv[1] );
- std::vector< std::pair<double,double> > dominant_intervals = p.dominant_intervals( atoi( argv[2] ) );
- cout << "Here are the dominant intervals : " << endl;
- for ( size_t i = 0 ; i != dominant_intervals.size() ; ++i )
- {
- cout << " " << dominant_intervals[i].first<< "," << dominant_intervals[i].second << " "<< endl;
- }
-
- return 0;
-}
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp b/src/Gudhi_stat/example/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
deleted file mode 100644
index dd2f3f99..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
+++ /dev/null
@@ -1,69 +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): Pawel Dlotko
- *
- * Copyright (C) 2015 INRIA Sophia-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/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/concretizations/Persistence_intervals.h>
-
-#include <iostream>
-
-
-
-using namespace Gudhi;
-using namespace Gudhi::Gudhi_stat;
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- std::cout << "This program compute a histogram of barcode's length. A number of bins in the histogram is a parameter of this program. \n";
- if ( argc != 3 )
- {
- cout << "To run this program, please provide the name of a file with persistence diagram and number of dominant intervals you would like to get \n";
- return 1;
- }
-
- Persistence_intervals p( argv[1] );
- std::vector< std::pair<double,double> > dominant_intervals = p.dominant_intervals( atoi( argv[2] ) );
- std::vector< size_t > histogram = p.histograms_of_lengths( 10 );
-
- std::stringstream gnuplot_script;
- gnuplot_script << argv[1] << "_Gnuplot_script";
- ofstream out;
- out.open( gnuplot_script.str().c_str() );
-
- out << "set style data histogram" << std::endl;
- out << "set style histogram cluster gap 1" << std::endl;
- out << "set style fill solid border -1" << std::endl;
- out << "plot '-' notitle" << std::endl;
- for ( size_t i = 0 ; i != histogram.size() ; ++i )
- {
- out << histogram[i] << std::endl;
- }
- out << endl;
- std::cout << "To vizualize, open gnuplot and type: load \'" << gnuplot_script.str().c_str() << "\'" << std::endl;
- out.close();
- return 0;
-}
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp b/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp
deleted file mode 100644
index 33ff7bce..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp
+++ /dev/null
@@ -1,93 +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): Pawel Dlotko
- *
- * Copyright (C) 2015 INRIA Sophia-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/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/concretizations/Persistence_intervals.h>
-
-#include <iostream>
-
-
-
-using namespace Gudhi;
-using namespace Gudhi::Gudhi_stat;
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- std::cout << "This program compute a plot of persistence Betti numbers. The input parameter is a file with persistence intervals. \n";
- if ( argc != 2 )
- {
- cout << "To run this program, please provide the name of a file with persistence diagram and number of dominant intervals you would like to get \n";
- return 1;
- }
-
-
-
- std::stringstream gnuplot_script;
- gnuplot_script << argv[1] << "_Gnuplot_script";
- ofstream out;
- out.open( gnuplot_script.str().c_str() );
-
- Persistence_intervals p( argv[1] );
- std::vector< std::pair< double , size_t > > pbns = p.compute_persistent_betti_numbers();
-
- //set up the ranges so that we see the image well.
- double xRangeBegin = pbns[0].first;
- double xRangeEnd = pbns[ pbns.size()-1 ].first;
- double yRangeBegin = 0;
- double yRangeEnd = 0;
- for ( size_t i = 0 ; i != pbns.size() ; ++i )
- {
- if ( pbns[i].second > yRangeEnd )yRangeEnd = pbns[i].second;
- }
- xRangeBegin -= (xRangeEnd -xRangeBegin)/100.0;
- xRangeEnd += (xRangeEnd -xRangeBegin)/100.0;
- yRangeEnd += yRangeEnd/100;
-
-
- out << "set xrange [" << xRangeBegin << " : " << xRangeEnd << "]" << endl;
- out << "set yrange [" << yRangeBegin << " : " << yRangeEnd << "]" << endl;
- out << "plot '-' using 1:2 notitle with lp " << std::endl;
- double previous_y = 0;
- for ( size_t i = 0 ; i != pbns.size() ; ++i )
- {
- out << pbns[i].first << " " << previous_y << endl;
- out << pbns[i].first << " " << pbns[i].second << std::endl;
- previous_y = pbns[i].second;
- }
- out << endl;
- out.close();
-
- //for ( size_t i = 0 ; i != pbns.size() ; ++i )
- //{
- // cout << pbns[i].first << " " << pbns[i].second << std::endl;
- //}
-
- std::cout << "To vizualize, open gnuplot and type: load \'" << gnuplot_script.str().c_str() << "\'" << std::endl;
-
- return 0;
-}
diff --git a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_intervals.cpp b/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_intervals.cpp
deleted file mode 100644
index c4dd7284..00000000
--- a/src/Gudhi_stat/example/utilities/persistence_intervals/plot_persistence_intervals.cpp
+++ /dev/null
@@ -1,59 +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): Pawel Dlotko
- *
- * Copyright (C) 2015 INRIA Sophia-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/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/concretizations/Persistence_intervals.h>
-
-#include <iostream>
-
-
-
-using namespace Gudhi;
-using namespace Gudhi::Gudhi_stat;
-
-
-double epsilon = 0.0000005;
-
-using namespace std;
-
-
-int main( int argc , char** argv )
-{
- if ( argc != 2 )
- {
- cout << "To run this program, please provide the name of a file with persistence diagram \n";
- return 1;
- }
- Persistence_intervals b( argv[1] );
- b.plot( argv[1] );
- return 0;
-}
-
-
-
-
-
-
-