summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/example
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-27 08:53:57 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-27 08:53:57 +0000
commit7a701f8a2326268b2aadb369fbc0848b227078a1 (patch)
treef5d17d492a5e5e1a61c6eae785beee08506e0637 /src/Bottleneck_distance/example
parent2f0d4a7a06f8fde904b75b27c3836e362f549707 (diff)
Fix naming conventions and cpplint
Add Bottleneck_distance to GUDHI_MODULES in GUDHI_user_version_target.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1569 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b96a2be25477ddf227e43d9941989f93a0f626bb
Diffstat (limited to 'src/Bottleneck_distance/example')
-rw-r--r--src/Bottleneck_distance/example/bottleneck_example.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Bottleneck_distance/example/bottleneck_example.cpp b/src/Bottleneck_distance/example/bottleneck_example.cpp
index 472c5c84..0bec9746 100644
--- a/src/Bottleneck_distance/example/bottleneck_example.cpp
+++ b/src/Bottleneck_distance/example/bottleneck_example.cpp
@@ -28,12 +28,9 @@
#include <sstream>
#include <string>
-using namespace std;
-
-//PD: I am using this type of procedures a lot in Gudhi stat. We should make one for all at some point.
std::vector< std::pair<double, double> > read_diagram_from_file( const char* filename )
{
- ifstream in;
+ std::ifstream in;
in.open( filename );
std::vector< std::pair<double, double> > result;
if ( !in.is_open() )
@@ -58,13 +55,15 @@ std::vector< std::pair<double, double> > read_diagram_from_file( const char* fil
}
in.close();
return result;
-}//read_diagram_from_file
+} //read_diagram_from_file
int main( int argc , char** argv )
{
if ( argc < 3 )
{
- std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck distance (set by default to zero). The program will now terminate \n";
+ std::cout << "To run this program please provide as an input two files with persistence diagrams. Each file " <<
+ "should contain a birth-death pair per line. Third, optional parameter is an error bound on a bottleneck" <<
+ " distance (set by default to zero). The program will now terminate \n";
}
std::vector< std::pair< double , double > > diag1 = read_diagram_from_file( argv[1] );
std::vector< std::pair< double , double > > diag2 = read_diagram_from_file( argv[2] );
@@ -73,6 +72,6 @@ int main( int argc , char** argv )
{
tolerance = atof( argv[3] );
}
- double b = Gudhi::Bottleneck_distance::compute(diag1, diag2, tolerance);
+ double b = Gudhi::bottleneck_distance::compute(diag1, diag2, tolerance);
std::cout << "The distance between the diagrams is : " << b << ". The tolerace is : " << tolerance << std::endl;
}