summaryrefslogtreecommitdiff
path: root/src/Gudhi_stat/utilities/persistence_intervals
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gudhi_stat/utilities/persistence_intervals')
-rw-r--r--src/Gudhi_stat/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp8
-rw-r--r--src/Gudhi_stat/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp8
-rw-r--r--src/Gudhi_stat/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp8
-rw-r--r--src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp16
-rw-r--r--src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_intervals.cpp4
5 files changed, 17 insertions, 27 deletions
diff --git a/src/Gudhi_stat/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp b/src/Gudhi_stat/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
index d73165b7..46711d27 100644
--- a/src/Gudhi_stat/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
+++ b/src/Gudhi_stat/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
@@ -34,20 +34,18 @@
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";
+ // std::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::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 )
@@ -66,6 +64,6 @@ int main( int argc , char** argv )
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;
+ std::cout << "Birth-death range : min: " << min_ << ", max: " << max_ << std::endl;
return 0;
}
diff --git a/src/Gudhi_stat/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp b/src/Gudhi_stat/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
index d4949932..8c263705 100644
--- a/src/Gudhi_stat/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
+++ b/src/Gudhi_stat/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
@@ -32,24 +32,22 @@
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";
+ std::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;
+ std::cout << "Here are the dominant intervals : " << std::endl;
for ( size_t i = 0 ; i != dominant_intervals.size() ; ++i )
{
- cout << " " << dominant_intervals[i].first<< "," << dominant_intervals[i].second << " "<< endl;
+ std::cout << " " << dominant_intervals[i].first<< "," << dominant_intervals[i].second << " "<< std::endl;
}
return 0;
diff --git a/src/Gudhi_stat/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp b/src/Gudhi_stat/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
index 96e6fa47..f21afdd2 100644
--- a/src/Gudhi_stat/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
+++ b/src/Gudhi_stat/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
@@ -32,15 +32,13 @@
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";
+ std::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;
}
@@ -50,7 +48,7 @@ int main( int argc , char** argv )
std::stringstream gnuplot_script;
gnuplot_script << argv[1] << "_Gnuplot_script";
- ofstream out;
+ std::ofstream out;
out.open( gnuplot_script.str().c_str() );
out << "set style data histogram" << std::endl;
@@ -61,7 +59,7 @@ int main( int argc , char** argv )
{
out << histogram[i] << std::endl;
}
- out << endl;
+ out << std::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/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp b/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp
index e4efdf79..d12c4605 100644
--- a/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp
+++ b/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_Betti_numebrs.cpp
@@ -32,15 +32,13 @@
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";
+ std::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;
}
@@ -48,7 +46,7 @@ int main( int argc , char** argv )
std::stringstream gnuplot_script;
gnuplot_script << argv[1] << "_Gnuplot_script";
- ofstream out;
+ std::ofstream out;
out.open( gnuplot_script.str().c_str() );
Persistence_intervals p( argv[1] );
@@ -68,22 +66,22 @@ int main( int argc , char** argv )
yRangeEnd += yRangeEnd/100;
- out << "set xrange [" << xRangeBegin << " : " << xRangeEnd << "]" << endl;
- out << "set yrange [" << yRangeBegin << " : " << yRangeEnd << "]" << endl;
+ out << "set xrange [" << xRangeBegin << " : " << xRangeEnd << "]" << std::endl;
+ out << "set yrange [" << yRangeBegin << " : " << yRangeEnd << "]" << std::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 << " " << previous_y << std::endl;
out << pbns[i].first << " " << pbns[i].second << std::endl;
previous_y = pbns[i].second;
}
- out << endl;
+ out << std::endl;
out.close();
//for ( size_t i = 0 ; i != pbns.size() ; ++i )
//{
- // cout << pbns[i].first << " " << pbns[i].second << std::endl;
+ // std::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;
diff --git a/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_intervals.cpp b/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_intervals.cpp
index 2c398742..d2e49ef3 100644
--- a/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_intervals.cpp
+++ b/src/Gudhi_stat/utilities/persistence_intervals/plot_persistence_intervals.cpp
@@ -36,14 +36,12 @@ 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";
+ std::cout << "To run this program, please provide the name of a file with persistence diagram \n";
return 1;
}