diff options
author | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-21 12:52:57 +0000 |
---|---|---|
committer | pdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-21 12:52:57 +0000 |
commit | 048eb8b5decf397d1d1f193d50049bcc6ca308c2 (patch) | |
tree | 217da70065f431261fdb988c914c93900421f9a0 /src/Gudhi_stat/example | |
parent | 4b8808e1f5c31634d00e7440d3d93cb37da0bf6f (diff) |
A few more changes for persistence heat maps.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_stat@1527 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 91bbfb521a74b0c8683bac4a605d50cf672638c8
Diffstat (limited to 'src/Gudhi_stat/example')
-rw-r--r-- | src/Gudhi_stat/example/persistence_heat_maps.cpp | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/src/Gudhi_stat/example/persistence_heat_maps.cpp b/src/Gudhi_stat/example/persistence_heat_maps.cpp new file mode 100644 index 00000000..475569c8 --- /dev/null +++ b/src/Gudhi_stat/example/persistence_heat_maps.cpp @@ -0,0 +1,108 @@ +/* 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_heat_maps.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; + //} + +/* + std::vector< std::pair< double,double > > intervals; + intervals.push_back( std::make_pair(0.5,0.5) ); + std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1); + Persistence_heat_maps p( intervals , filter , constant_function, false , 100 , 0 , 1 ); + p.plot( "heat_map_1" ); + + + std::vector< std::pair< double,double > > intervals2; + intervals2.push_back( std::make_pair(7,12) ); + Persistence_heat_maps q( intervals2 , filter , constant_function, false , 100 , 0 , 10 ); + q.plot( "heat_map_2" ); +*/ +/* + std::vector< std::pair< double,double > > intervals; + intervals.push_back( std::make_pair(0.5,0.5) ); + std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1); + Persistence_heat_maps p( intervals , filter , constant_function, false , 10 , 0 , 1 ); + p.write_to_file( "aaa" ); + + Persistence_heat_maps q; + q.load_from_file( "aaa" ); + + cerr << ( p == q ) << endl; + */ + +/* + std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1); + Persistence_heat_maps p( "file_with_diagram" , filter , constant_function, false , 100 , 0 , 1 ); + p.plot( "heat_map_1" ); +*/ + +/* + //test to construct persistence heat map: + std::vector< std::vector<double> > filter = create_Gaussian_filter(100,1); + Persistence_heat_maps p( "file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 ); + p.write_to_file( "persistence_heat_map_from_file_with_diagram" ); + + Persistence_heat_maps q; + q.load_from_file( "persistence_heat_map_from_file_with_diagram" ); + + cerr << (p == q) << endl; +*/ + + + + + + + + return 0; +} + + + + + + + |