summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Gudhi_stat/example/persistence_heat_maps.cpp15
-rw-r--r--src/Gudhi_stat/example/persistence_intervals.cpp1
-rw-r--r--src/Gudhi_stat/example/persistence_landscape.cpp1
-rw-r--r--src/Gudhi_stat/example/persistence_landscape_on_grid.cpp1
-rw-r--r--src/Gudhi_stat/include/gudhi/concretizations/PSSK.h4
-rw-r--r--src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h147
-rw-r--r--src/Gudhi_stat/include/gudhi/concretizations/read_persitence_from_file.h2
-rw-r--r--src/Gudhi_stat/include/gudhi/topological_process.h64
-rw-r--r--src/Gudhi_stat/test/persistence_heat_maps_test.cpp61
-rw-r--r--src/Gudhi_stat/test/persistence_intervals_test.cpp1
-rw-r--r--src/Gudhi_stat/test/persistence_lanscapes_on_grid_test.cpp1
-rw-r--r--src/Gudhi_stat/test/persistence_lanscapes_test.cpp1
-rw-r--r--src/Gudhi_stat/utilities/CMakeLists.txt2
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp6
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp4
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp4
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp2
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_arctan_of_their_persistence.cpp2
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_distance_from_diagonal.cpp2
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_squared_distance_from_diagonal.cpp2
-rw-r--r--src/Gudhi_stat/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp2
21 files changed, 180 insertions, 145 deletions
diff --git a/src/Gudhi_stat/example/persistence_heat_maps.cpp b/src/Gudhi_stat/example/persistence_heat_maps.cpp
index 645f63f7..1d7a131a 100644
--- a/src/Gudhi_stat/example/persistence_heat_maps.cpp
+++ b/src/Gudhi_stat/example/persistence_heat_maps.cpp
@@ -23,7 +23,6 @@
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_heat_maps.h>
#include <iostream>
@@ -61,27 +60,27 @@ int main( int argc , char** argv )
std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1);
//creating two heat maps.
- Persistence_heat_maps hm1( persistence1 , filter , constant_function, false , 20 , 0 , 11 );
- Persistence_heat_maps hm2( persistence2 , filter , constant_function, false , 20 , 0 , 11 );
+ Persistence_heat_maps<constant_scaling_function> hm1( persistence1 , filter , false , 20 , 0 , 11 );
+ Persistence_heat_maps<constant_scaling_function> hm2( persistence2 , filter , false , 20 , 0 , 11 );
- std::vector<Persistence_heat_maps*> vector_of_maps;
+ std::vector<Persistence_heat_maps<constant_scaling_function>*> vector_of_maps;
vector_of_maps.push_back( &hm1 );
vector_of_maps.push_back( &hm2 );
//compute median/mean of a vector of heat maps:
- Persistence_heat_maps mean;
+ Persistence_heat_maps<constant_scaling_function> mean;
mean.compute_mean( vector_of_maps );
- Persistence_heat_maps median;
+ Persistence_heat_maps<constant_scaling_function> median;
median.compute_median( vector_of_maps );
//to compute L^1 disance between hm1 and hm2:
std::cout << "The L^1 distance is : " << hm1.distance( hm2 , 1 ) << std::endl;
//to average of hm1 and hm2:
- std::vector< Persistence_heat_maps* > to_average;
+ std::vector< Persistence_heat_maps<constant_scaling_function>* > to_average;
to_average.push_back( &hm1 );
to_average.push_back( &hm2 );
- Persistence_heat_maps av;
+ Persistence_heat_maps<constant_scaling_function> av;
av.compute_average( to_average );
//to compute scalar product of hm1 and hm2:
diff --git a/src/Gudhi_stat/example/persistence_intervals.cpp b/src/Gudhi_stat/example/persistence_intervals.cpp
index 5357def7..6e2b0ddb 100644
--- a/src/Gudhi_stat/example/persistence_intervals.cpp
+++ b/src/Gudhi_stat/example/persistence_intervals.cpp
@@ -23,7 +23,6 @@
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_intervals.h>
#include <iostream>
diff --git a/src/Gudhi_stat/example/persistence_landscape.cpp b/src/Gudhi_stat/example/persistence_landscape.cpp
index 106864c0..7ba9387d 100644
--- a/src/Gudhi_stat/example/persistence_landscape.cpp
+++ b/src/Gudhi_stat/example/persistence_landscape.cpp
@@ -22,7 +22,6 @@
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_landscape.h>
diff --git a/src/Gudhi_stat/example/persistence_landscape_on_grid.cpp b/src/Gudhi_stat/example/persistence_landscape_on_grid.cpp
index 223c9d50..331ae4ae 100644
--- a/src/Gudhi_stat/example/persistence_landscape_on_grid.cpp
+++ b/src/Gudhi_stat/example/persistence_landscape_on_grid.cpp
@@ -22,7 +22,6 @@
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_landscape_on_grid.h>
diff --git a/src/Gudhi_stat/include/gudhi/concretizations/PSSK.h b/src/Gudhi_stat/include/gudhi/concretizations/PSSK.h
index 8168b7a7..e61711f4 100644
--- a/src/Gudhi_stat/include/gudhi/concretizations/PSSK.h
+++ b/src/Gudhi_stat/include/gudhi/concretizations/PSSK.h
@@ -41,7 +41,7 @@ namespace Gudhi_stat
* at (q,p)
**/
-class PSSK : public Persistence_heat_maps
+class PSSK : public Persistence_heat_maps<constant_scaling_function>
{
public:
PSSK():Persistence_heat_maps(){}
@@ -103,7 +103,7 @@ void PSSK::construct( const std::vector< std::pair<double,double> >& intervals_
this->min_ = min_;
this->max_ = max_;
- this->scalling_function_with_respect_to_distance_from_diagonal = scalling_function_with_respect_to_distance_from_diagonal;
+
//initialization of the structure heat_map
diff --git a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
index d2c1bfc9..f846ac08 100644
--- a/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
+++ b/src/Gudhi_stat/include/gudhi/concretizations/Persistence_heat_maps.h
@@ -122,26 +122,42 @@ std::vector< std::vector<double> > create_Gaussian_filter( size_t pixel_radius ,
* (4) Scale them with
**/
-double constant_function( const std::pair< double , double >& point_in_diagram )
-{
- return 1;
-}
+class constant_scaling_function
+{
+public:
+ double operator()( const std::pair< double , double >& point_in_diagram )
+ {
+ return 1;
+ }
+};
-double distance_from_diagonal( const std::pair< double , double >& point_in_diagram )
+class distance_from_diagonal_scalling
{
- //(point_in_diagram.first+point_in_diagram.second)/2.0
- return sqrt( pow((point_in_diagram.first-(point_in_diagram.first+point_in_diagram.second)/2.0),2) + pow((point_in_diagram.second-(point_in_diagram.first+point_in_diagram.second)/2.0),2) );
-}
+public:
+ double operator()( const std::pair< double , double >& point_in_diagram )
+ {
+ //(point_in_diagram.first+point_in_diagram.second)/2.0
+ return sqrt( pow((point_in_diagram.first-(point_in_diagram.first+point_in_diagram.second)/2.0),2) + pow((point_in_diagram.second-(point_in_diagram.first+point_in_diagram.second)/2.0),2) );
+ }
+};
-double squared_distance_from_diagonal( const std::pair< double , double >& point_in_diagram )
+class squared_distance_from_diagonal_scaling
{
- return pow((point_in_diagram.first-(point_in_diagram.first+point_in_diagram.second)/2.0),2) + pow((point_in_diagram.second-(point_in_diagram.first+point_in_diagram.second)/2.0),2);
-}
+public:
+ double operator()( const std::pair< double , double >& point_in_diagram )
+ {
+ return pow((point_in_diagram.first-(point_in_diagram.first+point_in_diagram.second)/2.0),2) + pow((point_in_diagram.second-(point_in_diagram.first+point_in_diagram.second)/2.0),2);
+ }
+};
-double arc_tan_of_persistence_of_point( const std::pair< double , double >& point_in_diagram )
+class arc_tan_of_persistence_of_point
{
- return atan( point_in_diagram.second - point_in_diagram.first );
-}
+public:
+ double operator()( const std::pair< double , double >& point_in_diagram )
+ {
+ return atan( point_in_diagram.second - point_in_diagram.first );
+ }
+};
class weight_by_setting_maximal_interval_to_have_length_one
{
@@ -159,6 +175,7 @@ private:
/**
* This class implements the following concepts: Vectorized_topological_data, Topological_data_with_distances, Real_valued_topological_data, Topological_data_with_averages, Topological_data_with_scalar_product
**/
+template <typename Scalling_of_kernels = constant_scaling_function>
class Persistence_heat_maps
{
public:
@@ -167,7 +184,8 @@ public:
**/
Persistence_heat_maps()
{
- this->scalling_function_with_respect_to_distance_from_diagonal = constant_function;
+ Scalling_of_kernels f;
+ this->f = f;
this->erase_below_diagonal = false;
this->min_ = this->max_ = 0;
this->set_up_parameters_for_basic_classes();
@@ -177,13 +195,12 @@ public:
* Construction that takes at the input the following parameters:
* (1) A vector of pairs of doubles (representing persistence intervals). All other parameters are optional. They are:
* (2) a Gausian filter generated by create_Gaussian_filter filter (the default value of this vaiable is a Gaussian filter of a radius 5),
- * (3) a scaling function (constant by default). This function allows to put a different weights to points depending on their position, in particular, depending on their distance from diagonal,
- * (4) a boolean value which determines if the area of image below diagonal should, or should not be erased (it will be erased by default).
- * (5) a number of pixels in each direction (set to 1000 by default).
- * (6) a min x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data,
+ * (3) a boolean value which determines if the area of image below diagonal should, or should not be erased (it will be erased by default).
+ * (4) a number of pixels in each direction (set to 1000 by default).
+ * (5) a min x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data,
* (6) a max x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data.
**/
- Persistence_heat_maps( const std::vector< std::pair< double,double > > & interval , std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1) , double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ) = constant_function, bool erase_below_diagonal = false , size_t number_of_pixels = 1000 , double min_ = -1 , double max_ = -1 );
+ Persistence_heat_maps( const std::vector< std::pair< double,double > > & interval , std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1) , bool erase_below_diagonal = false , size_t number_of_pixels = 1000 , double min_ = -1 , double max_ = -1 );
/**
* Construction that takes at the input a name of a file with persistence intervals, a filter (radius 5 by default), a scaling function (constant by default), a boolean value which determines if the area of image below diagonal should, or should not be erased (should by default). The next parameter is the number of pixels in each direction (set to 1000 by default). and min and max values of images (both set to -1 by defaulet. If this is the case, the program will pick the right values based on the data).
@@ -191,14 +208,13 @@ public:
/**
* Construction that takes at the input the following parameters:
* (1) A a name of a file with persistence intervals. The file shold be readable by the function read_standard_file. All other parameters are optional. They are:
- * (2) a Gausian filter generated by create_Gaussian_filter filter (the default value of this vaiable is a Gaussian filter of a radius 5),
- * (3) a scaling function (constant by default). This function allows to put a different weights to points depending on their position, in particular, depending on their distance from diagonal,
- * (4) a boolean value which determines if the area of image below diagonal should, or should not be erased (it will be erased by default).
- * (5) a number of pixels in each direction (set to 1000 by default).
- * (6) a min x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data,
+ * (2) a Gausian filter generated by create_Gaussian_filter filter (the default value of this vaiable is a Gaussian filter of a radius 5),
+ * (3) a boolean value which determines if the area of image below diagonal should, or should not be erased (it will be erased by default).
+ * (4) a number of pixels in each direction (set to 1000 by default).
+ * (5) a min x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data,
* (6) a max x and y value of points that are to be taken into account. By default it is set to -1, in which case the program compute the values based on the data.
**/
- Persistence_heat_maps( const char* filename , std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1) , double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ) = constant_function, bool erase_below_diagonal = false , size_t number_of_pixels = 1000 , double min_ = -1 , double max_ = -1 );
+ Persistence_heat_maps( const char* filename , std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1), bool erase_below_diagonal = false , size_t number_of_pixels = 1000 , double min_ = -1 , double max_ = -1 );
/**
@@ -368,7 +384,7 @@ protected:
size_t number_of_functions_for_projections_to_reals;
void construct( const std::vector< std::pair<double,double> >& intervals_ ,
std::vector< std::vector<double> > filter = create_Gaussian_filter(5,1),
- double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ) = constant_function,
+
bool erase_below_diagonal = false , size_t number_of_pixels = 1000 , double min_ = -1 , double max_ = -1 );
void set_up_parameters_for_basic_classes()
@@ -378,7 +394,8 @@ protected:
}
//data
- double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram );
+ //double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram );
+ Scalling_of_kernels f;
bool erase_below_diagonal;
double min_;
double max_;
@@ -387,13 +404,15 @@ protected:
//if min_ == max_, then the program is requested to set up the values itself based on persistence intervals
-void Persistence_heat_maps::construct( const std::vector< std::pair<double,double> >& intervals_ ,
- std::vector< std::vector<double> > filter,
- double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ),
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::construct( const std::vector< std::pair<double,double> >& intervals_ ,
+ std::vector< std::vector<double> > filter,
bool erase_below_diagonal , size_t number_of_pixels , double min_ , double max_ )
{
bool dbg = false;
if ( dbg )std::cerr << "Entering construct procedure \n";
+ Scalling_of_kernels f;
+ this->f = f;
if ( min_ == max_ )
{
@@ -423,9 +442,7 @@ void Persistence_heat_maps::construct( const std::vector< std::pair<double,doubl
}
this->min_ = min_;
- this->max_ = max_;
- this->scalling_function_with_respect_to_distance_from_diagonal = scalling_function_with_respect_to_distance_from_diagonal;
-
+ this->max_ = max_;
//initialization of the structure heat_map
std::vector< std::vector<double> > heat_map_;
@@ -463,7 +480,7 @@ void Persistence_heat_maps::construct( const std::vector< std::pair<double,doubl
std::cerr << "y_grid : " << y_grid << endl;
}
- double scaling_value = this->scalling_function_with_respect_to_distance_from_diagonal(intervals_[pt_nr]);
+ double scaling_value = this->f(intervals_[pt_nr]);
for ( size_t i = 0 ; i != filter.size() ; ++i )
@@ -502,30 +519,29 @@ void Persistence_heat_maps::construct( const std::vector< std::pair<double,doubl
}
}//construct
-
-Persistence_heat_maps::Persistence_heat_maps( const std::vector< std::pair< double,double > > & interval ,
+template <typename Scalling_of_kernels>
+Persistence_heat_maps<Scalling_of_kernels>::Persistence_heat_maps( const std::vector< std::pair< double,double > > & interval ,
std::vector< std::vector<double> > filter,
- double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ),
bool erase_below_diagonal , size_t number_of_pixels , double min_ , double max_ )
{
- this->construct( interval , filter , scalling_function_with_respect_to_distance_from_diagonal, erase_below_diagonal , number_of_pixels , min_ , max_ );
+ this->construct( interval , filter , erase_below_diagonal , number_of_pixels , min_ , max_ );
this->set_up_parameters_for_basic_classes();
}
-Persistence_heat_maps::Persistence_heat_maps( const char* filename ,
- std::vector< std::vector<double> > filter,
- double (*scalling_function_with_respect_to_distance_from_diagonal)( const std::pair< double , double >& point_in_diagram ),
+template <typename Scalling_of_kernels>
+Persistence_heat_maps<Scalling_of_kernels>::Persistence_heat_maps( const char* filename ,
+ std::vector< std::vector<double> > filter,
bool erase_below_diagonal , size_t number_of_pixels , double min_ , double max_ )
{
std::vector< std::pair< double , double > > intervals_ = read_standard_file( filename );
- this->construct( intervals_ , filter , scalling_function_with_respect_to_distance_from_diagonal, erase_below_diagonal , number_of_pixels , min_ , max_ );
+ this->construct( intervals_ , filter, erase_below_diagonal , number_of_pixels , min_ , max_ );
this->set_up_parameters_for_basic_classes();
}
-
-std::vector< std::vector<double> > Persistence_heat_maps::check_and_initialize_maps( const std::vector<Persistence_heat_maps*>& maps )
+template <typename Scalling_of_kernels>
+std::vector< std::vector<double> > Persistence_heat_maps<Scalling_of_kernels>::check_and_initialize_maps( const std::vector<Persistence_heat_maps*>& maps )
{
//checking if all the heat maps are of the same size:
for ( size_t i = 0 ; i != maps.size() ; ++i )
@@ -550,8 +566,8 @@ std::vector< std::vector<double> > Persistence_heat_maps::check_and_initialize_m
return heat_maps;
}
-
-void Persistence_heat_maps::compute_median( const std::vector<Persistence_heat_maps*>& maps )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::compute_median( const std::vector<Persistence_heat_maps*>& maps )
{
std::vector< std::vector<double> > heat_maps = this->check_and_initialize_maps( maps );
@@ -574,8 +590,8 @@ void Persistence_heat_maps::compute_median( const std::vector<Persistence_heat_m
}
-
-void Persistence_heat_maps::compute_mean( const std::vector<Persistence_heat_maps*>& maps )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::compute_mean( const std::vector<Persistence_heat_maps*>& maps )
{
std::vector< std::vector<double> > heat_maps = this->check_and_initialize_maps( maps );
for ( size_t i = 0 ; i != heat_maps.size() ; ++i )
@@ -597,8 +613,8 @@ void Persistence_heat_maps::compute_mean( const std::vector<Persistence_heat_map
-
-void Persistence_heat_maps::compute_percentage_of_active( const std::vector<Persistence_heat_maps*>& maps , size_t cutoff )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::compute_percentage_of_active( const std::vector<Persistence_heat_maps*>& maps , size_t cutoff )
{
std::vector< std::vector<double> > heat_maps = this->check_and_initialize_maps( maps );
@@ -627,8 +643,8 @@ void Persistence_heat_maps::compute_percentage_of_active( const std::vector<Pers
}
-
-void Persistence_heat_maps::plot( const char* filename )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::plot( const char* filename )
{
ofstream out;
std::stringstream ss;
@@ -649,8 +665,8 @@ void Persistence_heat_maps::plot( const char* filename )
}
-
-void Persistence_heat_maps::print_to_file( const char* filename )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::print_to_file( const char* filename )
{
ofstream out;
@@ -669,8 +685,8 @@ void Persistence_heat_maps::print_to_file( const char* filename )
out.close();
}
-
-void Persistence_heat_maps::load_from_file( const char* filename )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::load_from_file( const char* filename )
{
bool dbg = false;
@@ -728,8 +744,9 @@ void Persistence_heat_maps::load_from_file( const char* filename )
}
-//Concretizations of virtual methods:
-std::vector<double> Persistence_heat_maps::vectorize( int number_of_function )
+//Concretizations of virtual methods:
+template <typename Scalling_of_kernels>
+std::vector<double> Persistence_heat_maps<Scalling_of_kernels>::vectorize( int number_of_function )
{
//convert this->heat_map into one large vector:
size_t size_of_result = 0;
@@ -752,7 +769,8 @@ std::vector<double> Persistence_heat_maps::vectorize( int number_of_function )
return result;
}
-double Persistence_heat_maps::distance( const Persistence_heat_maps& second , double power )
+template <typename Scalling_of_kernels>
+double Persistence_heat_maps<Scalling_of_kernels>::distance( const Persistence_heat_maps& second , double power )
{
//first we need to check if (*this) and second are defined on the same domain and have the same dimensions:
if ( !this->check_if_the_same(second) )
@@ -774,7 +792,8 @@ double Persistence_heat_maps::distance( const Persistence_heat_maps& second , do
return distance;
}
-double Persistence_heat_maps::project_to_R( int number_of_function )
+template <typename Scalling_of_kernels>
+double Persistence_heat_maps<Scalling_of_kernels>::project_to_R( int number_of_function )
{
double result = 0;
for ( size_t i = 0 ; i != this->heat_map.size() ; ++i )
@@ -787,12 +806,14 @@ double Persistence_heat_maps::project_to_R( int number_of_function )
return result;
}
-void Persistence_heat_maps::compute_average( const std::vector< Persistence_heat_maps* >& to_average )
+template <typename Scalling_of_kernels>
+void Persistence_heat_maps<Scalling_of_kernels>::compute_average( const std::vector< Persistence_heat_maps* >& to_average )
{
this->compute_mean( to_average );
}
-double Persistence_heat_maps::compute_scalar_product( const Persistence_heat_maps& second )
+template <typename Scalling_of_kernels>
+double Persistence_heat_maps<Scalling_of_kernels>::compute_scalar_product( const Persistence_heat_maps& second )
{
//first we need to check if (*this) and second are defined on the same domain and have the same dimensions:
if ( !this->check_if_the_same(second) )
diff --git a/src/Gudhi_stat/include/gudhi/concretizations/read_persitence_from_file.h b/src/Gudhi_stat/include/gudhi/concretizations/read_persitence_from_file.h
index 0a740996..953547c7 100644
--- a/src/Gudhi_stat/include/gudhi/concretizations/read_persitence_from_file.h
+++ b/src/Gudhi_stat/include/gudhi/concretizations/read_persitence_from_file.h
@@ -105,7 +105,7 @@ std::vector< std::pair< double,double > > read_file_names_that_may_contain_inf_s
/**
* This procedure reads names of files which are stored in a file.
**/
-std::vector< std::string > readFileNames( char* filenameWithFilenames )
+std::vector< std::string > readFileNames( const char* filenameWithFilenames )
{
bool dbg = false;
diff --git a/src/Gudhi_stat/include/gudhi/topological_process.h b/src/Gudhi_stat/include/gudhi/topological_process.h
index d8d8e696..729ef2f8 100644
--- a/src/Gudhi_stat/include/gudhi/topological_process.h
+++ b/src/Gudhi_stat/include/gudhi/topological_process.h
@@ -20,12 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PERMUTATION_TEST_H
-#define PERMUTATION_TEST_H
-//abstract classes:
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
-#include <gudhi/abstract_classes/Abs_Topological_data_with_averages.h>
-#include <gudhi/abstract_classes/Abs_Topological_data_with_distances.h>
+#ifndef TOPOLOGICAL_PROCESS_H
+#define TOPOLOGICAL_PROCESS_H
//concretizations
@@ -41,14 +37,48 @@ namespace Gudhi
{
namespace Gudhi_stat
{
+
+
+template <typename Representation>
+std::vector< Representation* > construct_representation_from_file( const char* filename )
+{
+ bool dbg = false;
+ std::vector< std::string > files = readFileNames( filename );
+
+ std::cout << "Here are the filenames in the file : " << filename << std::endl;
+ for ( size_t i = 0 ; i != files.size() ; ++i )
+ {
+ std::cout << files[i] << std::endl;
+ }
+
+ std::vector< Representation* > result( files.size() );
+ for ( size_t i = 0 ; i != files.size() ; ++i )
+ {
+ std::vector< std::pair< double , double > > diag = read_standard_file( files[i].c_str() );
+
+ if ( dbg )
+ {
+ std::cerr << "Here is a diagram from a file : " << files[i].c_str() << std::endl;
+ for ( size_t aa = 0 ; aa != diag.size() ; ++aa )
+ {
+ std::cout << diag[aa].first << " " << diag[aa].second << std::endl;
+ }
+ getchar();
+ }
+
+ Representation* l = new Representation( diag );
+ result[i] = l;
+ }
+ return result;
+}
+
template <typename Representation>
class Topological_process
{
public:
Topological_process();
- Topological_process( const std::vetor< Representation* >& data_ ):data(data_){}
- Topological_process( const char* filename );//we assume that the filename contains a list of files with the diagrams.
+ Topological_process( const std::vector< Representation* >& data_ ):data(data_){}
double distance( const Topological_process& second )
{
if ( this->data.size() != second.data.size() )
@@ -58,12 +88,12 @@ public:
double result = 0;
for ( size_t i = 0 ; i != this->data.size() ; ++i )
{
- result += this->data[i].distance( secod.data[i] );
+ result += this->data[i]->distance( *second.data[i] );
}
return result;
}
- compute_average( const std::vector< Representation* >& to_average )
+ void compute_average( const std::vector< Representation* >& to_average )
{
//since we will substitute whatever data we have in this object with an average, we clear the data in this object first:
this->data.clear();
@@ -80,20 +110,10 @@ public:
//scalar products?
//confidence bounds?
private:
- std::vetor< Representation* > data;
+ std::vector< Representation* > data;
};
-template <typename Representation>
-Topological_process<Representation>::Topological_process( const char* filename )
-{
- std::vector< std::string > filenames = readFileNames( filename );
- this->data.reserve( filenames.size() );
- for ( size_t file = 0 ; file != filenames.size() ; ++file )
- {
- std::vector< std::pair<double,double> > intervals_in_this_file = read_file_names_that_may_contain_inf_string( filenames[i] );
- this-data[i] = new Representation( intervals_in_this_file );
- }
-}
+
}//Gudhi_stat
}//Gudhi
diff --git a/src/Gudhi_stat/test/persistence_heat_maps_test.cpp b/src/Gudhi_stat/test/persistence_heat_maps_test.cpp
index d9cba466..e46e45d3 100644
--- a/src/Gudhi_stat/test/persistence_heat_maps_test.cpp
+++ b/src/Gudhi_stat/test/persistence_heat_maps_test.cpp
@@ -26,7 +26,6 @@
#define BOOST_TEST_MODULE "gudhi_stat"
#include <boost/test/unit_test.hpp>
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_heat_maps.h>
#include <iostream>
@@ -44,10 +43,10 @@ using namespace std;
BOOST_AUTO_TEST_CASE(check_construction_of_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(100,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
p.print_to_file( "data/persistence_heat_map_from_file_with_diagram" );
- Persistence_heat_maps q;
+ Persistence_heat_maps<constant_scaling_function> q;
q.load_from_file( "data/persistence_heat_map_from_file_with_diagram" );
BOOST_CHECK( p == q );
@@ -57,18 +56,18 @@ BOOST_AUTO_TEST_CASE(check_construction_of_heat_maps)
BOOST_AUTO_TEST_CASE(check_averages_of_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 10 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 10 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 10 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 10 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 10 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 10 );
- std::vector< Persistence_heat_maps* > to_average;
+ std::vector< Persistence_heat_maps<constant_scaling_function>* > to_average;
to_average.push_back( &p );
to_average.push_back( &q );
to_average.push_back( &r );
- Persistence_heat_maps av;
+ Persistence_heat_maps<constant_scaling_function> av;
av.compute_average( to_average );
- Persistence_heat_maps template_average;
+ Persistence_heat_maps<constant_scaling_function> template_average;
template_average.load_from_file( "data/template_average_of_heat_maps" );
BOOST_CHECK( av == template_average );
@@ -78,18 +77,18 @@ BOOST_AUTO_TEST_CASE(check_averages_of_heat_maps)
BOOST_AUTO_TEST_CASE(check_median_of_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 1 );
- std::vector< Persistence_heat_maps* > to_compute_median;
+ std::vector< Persistence_heat_maps<constant_scaling_function>* > to_compute_median;
to_compute_median.push_back( &p );
to_compute_median.push_back( &q );
to_compute_median.push_back( &r );
- Persistence_heat_maps median;
+ Persistence_heat_maps<constant_scaling_function> median;
median.compute_median( to_compute_median );
- Persistence_heat_maps template_median;
+ Persistence_heat_maps<constant_scaling_function> template_median;
template_median.load_from_file( "data/template_median_of_heat_maps" );
BOOST_CHECK( median == template_median );
@@ -99,18 +98,18 @@ BOOST_AUTO_TEST_CASE(check_median_of_heat_maps)
BOOST_AUTO_TEST_CASE(check_compute_percentage_of_active_of_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 1 );
- std::vector< Persistence_heat_maps* > to_compute_percentage_of_active;
+ std::vector< Persistence_heat_maps<constant_scaling_function>* > to_compute_percentage_of_active;
to_compute_percentage_of_active.push_back( &p );
to_compute_percentage_of_active.push_back( &q );
to_compute_percentage_of_active.push_back( &r );
- Persistence_heat_maps percentage_of_active;
+ Persistence_heat_maps<constant_scaling_function> percentage_of_active;
percentage_of_active.compute_percentage_of_active( to_compute_percentage_of_active , 0.1 );
- Persistence_heat_maps template_percentage_of_active;
+ Persistence_heat_maps<constant_scaling_function> template_percentage_of_active;
template_percentage_of_active.load_from_file( "data/template_percentage_of_active_of_heat_maps" );
BOOST_CHECK( percentage_of_active == template_percentage_of_active );
@@ -119,7 +118,7 @@ BOOST_AUTO_TEST_CASE(check_compute_percentage_of_active_of_heat_maps)
BOOST_AUTO_TEST_CASE(check_vectorize_for_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 5 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 5 , 0 , 1 );
std::vector<double> p_vect_template;
@@ -160,9 +159,9 @@ BOOST_AUTO_TEST_CASE(check_vectorize_for_heat_maps)
BOOST_AUTO_TEST_CASE(check_distance_for_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 1 );
//cerr << p.distance( p ) << endl;
//cerr << p.distance( q ) << endl;
@@ -193,9 +192,9 @@ BOOST_AUTO_TEST_CASE(check_distance_for_heat_maps)
BOOST_AUTO_TEST_CASE(check_projections_to_R_for_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 1 );
//cerr << p.project_to_R(0) << endl;
//cerr << q.project_to_R(0) << endl;
@@ -210,9 +209,9 @@ BOOST_AUTO_TEST_CASE(check_projections_to_R_for_heat_maps)
BOOST_AUTO_TEST_CASE(check_scalar_products_for_heat_maps)
{
std::vector< std::vector<double> > filter = create_Gaussian_filter(30,1);
- Persistence_heat_maps p( "data/file_with_diagram" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps q( "data/file_with_diagram_1" , filter , constant_function, false , 1000 , 0 , 1 );
- Persistence_heat_maps r( "data/file_with_diagram_2" , filter , constant_function, false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> p( "data/file_with_diagram" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> q( "data/file_with_diagram_1" , filter , false , 1000 , 0 , 1 );
+ Persistence_heat_maps<constant_scaling_function> r( "data/file_with_diagram_2" , filter , false , 1000 , 0 , 1 );
//cerr << p.compute_scalar_product( p ) << endl;
//cerr << p.compute_scalar_product( q ) << endl;
diff --git a/src/Gudhi_stat/test/persistence_intervals_test.cpp b/src/Gudhi_stat/test/persistence_intervals_test.cpp
index f86300fa..02af8347 100644
--- a/src/Gudhi_stat/test/persistence_intervals_test.cpp
+++ b/src/Gudhi_stat/test/persistence_intervals_test.cpp
@@ -26,7 +26,6 @@
#define BOOST_TEST_MODULE "gudhi_stat"
#include <boost/test/unit_test.hpp>
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include "gudhi/concretizations/Persistence_intervals.h"
#include <iostream>
diff --git a/src/Gudhi_stat/test/persistence_lanscapes_on_grid_test.cpp b/src/Gudhi_stat/test/persistence_lanscapes_on_grid_test.cpp
index 17ed9fde..87ed0241 100644
--- a/src/Gudhi_stat/test/persistence_lanscapes_on_grid_test.cpp
+++ b/src/Gudhi_stat/test/persistence_lanscapes_on_grid_test.cpp
@@ -26,7 +26,6 @@
#define BOOST_TEST_MODULE "gudhi_stat"
#include <boost/test/unit_test.hpp>
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_landscape_on_grid.h>
#include <iostream>
diff --git a/src/Gudhi_stat/test/persistence_lanscapes_test.cpp b/src/Gudhi_stat/test/persistence_lanscapes_test.cpp
index 9ec7f880..eb00a718 100644
--- a/src/Gudhi_stat/test/persistence_lanscapes_test.cpp
+++ b/src/Gudhi_stat/test/persistence_lanscapes_test.cpp
@@ -26,7 +26,6 @@
#define BOOST_TEST_MODULE "gudhi_stat"
#include <boost/test/unit_test.hpp>
#include <gudhi/reader_utils.h>
-#include <gudhi/abstract_classes/Abs_Topological_data.h>
#include <gudhi/concretizations/Persistence_landscape.h>
#include <iostream>
diff --git a/src/Gudhi_stat/utilities/CMakeLists.txt b/src/Gudhi_stat/utilities/CMakeLists.txt
index e97c5708..f94c47ea 100644
--- a/src/Gudhi_stat/utilities/CMakeLists.txt
+++ b/src/Gudhi_stat/utilities/CMakeLists.txt
@@ -104,3 +104,5 @@ target_link_libraries(persistence_vectors/plot_persistence_vectors ${Boost_SYSTE
add_executable ( permutation_test permutation_test.cpp )
target_link_libraries(permutation_test ${Boost_SYSTEM_LIBRARY})
+add_executable ( topological_process topological_process.cpp )
+target_link_libraries(topological_process ${Boost_SYSTEM_LIBRARY})
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
index a3094e07..3ef863c6 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
@@ -49,15 +49,15 @@ int main( int argc , char** argv )
}
std::cout << "Creating persistence landscapes...\n";
- std::vector< Persistence_heat_maps* > maps;
+ std::vector< Persistence_heat_maps<constant_scaling_function>* > maps;
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
- Persistence_heat_maps* l = new Persistence_heat_maps;
+ Persistence_heat_maps<constant_scaling_function>* l = new Persistence_heat_maps<constant_scaling_function>;
l->load_from_file( filenames[i] );
maps.push_back( l );
}
- Persistence_heat_maps av;
+ Persistence_heat_maps<constant_scaling_function> av;
av.compute_average( maps );
av.print_to_file( "average.mps" );
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
index bfe2a7ab..efe4ec3d 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
@@ -51,11 +51,11 @@ int main( int argc , char** argv )
{
filenames.push_back( argv[i] );
}
- std::vector< Persistence_heat_maps > maps;
+ std::vector< Persistence_heat_maps<constant_scaling_function> > maps;
maps.reserve( filenames.size() );
for ( size_t file_no = 0 ; file_no != filenames.size() ; ++file_no )
{
- Persistence_heat_maps l;
+ Persistence_heat_maps<constant_scaling_function> l;
l.load_from_file( filenames[file_no] );
maps.push_back( l );
}
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
index d6899d1e..4caf30af 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
@@ -42,11 +42,11 @@ int main( int argc , char** argv )
{
filenames.push_back( argv[i] );
}
- std::vector< Persistence_heat_maps > maps;
+ std::vector< Persistence_heat_maps<constant_scaling_function> > maps;
maps.reserve( filenames.size() );
for ( size_t file_no = 0 ; file_no != filenames.size() ; ++file_no )
{
- Persistence_heat_maps l;
+ Persistence_heat_maps<constant_scaling_function> l;
l.load_from_file( filenames[file_no] );
maps.push_back( l );
}
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
index b300d350..d5f5d75f 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
@@ -67,7 +67,7 @@ int main( int argc , char** argv )
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
std::cout << "Creating a heat map based on a file : " << filenames[i] << std::endl;
- Persistence_heat_maps l( filenames[i] , filter, constant_function, false , size_of_grid , min_ , max_ );
+ Persistence_heat_maps<constant_scaling_function> l( filenames[i] , filter, false , size_of_grid , min_ , max_ );
std::stringstream ss;
ss << filenames[i] << ".mps";
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_arctan_of_their_persistence.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_arctan_of_their_persistence.cpp
index 3ce0fcec..6c306566 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_arctan_of_their_persistence.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_arctan_of_their_persistence.cpp
@@ -67,7 +67,7 @@ int main( int argc , char** argv )
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
std::cout << "Creating a heat map based on a file : " << filenames[i] << std::endl;
- Persistence_heat_maps l( filenames[i] , filter, arc_tan_of_persistence_of_point, false , size_of_grid , min_ , max_ );
+ Persistence_heat_maps<arc_tan_of_persistence_of_point> l( filenames[i] , filter, false , size_of_grid , min_ , max_ );
std::stringstream ss;
ss << filenames[i] << ".mps";
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_distance_from_diagonal.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_distance_from_diagonal.cpp
index 4738d946..f2e19508 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_distance_from_diagonal.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_distance_from_diagonal.cpp
@@ -66,7 +66,7 @@ int main( int argc , char** argv )
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
std::cout << "Creating a heat map based on a file : " << filenames[i] << std::endl;
- Persistence_heat_maps l( filenames[i] , filter, distance_from_diagonal, false , size_of_grid , min_ , max_ );
+ Persistence_heat_maps<distance_from_diagonal_scalling> l( filenames[i] , filter , size_of_grid , min_ , max_ );
std::stringstream ss;
ss << filenames[i] << ".mps";
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_squared_distance_from_diagonal.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_squared_distance_from_diagonal.cpp
index 8dab998a..91b3fb22 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_squared_distance_from_diagonal.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/create_persistence_heat_maps_weighted_by_squared_distance_from_diagonal.cpp
@@ -66,7 +66,7 @@ int main( int argc , char** argv )
for ( size_t i = 0 ; i != filenames.size() ; ++i )
{
std::cout << "Creating a heat map based on a file : " << filenames[i] << std::endl;
- Persistence_heat_maps l( filenames[i] , filter, squared_distance_from_diagonal, false , size_of_grid , min_ , max_ );
+ Persistence_heat_maps<squared_distance_from_diagonal_scaling> l( filenames[i] , filter, false , size_of_grid , min_ , max_ );
std::stringstream ss;
ss << filenames[i] << ".mps";
diff --git a/src/Gudhi_stat/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp b/src/Gudhi_stat/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
index c4eed502..39a46adb 100644
--- a/src/Gudhi_stat/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
+++ b/src/Gudhi_stat/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
@@ -35,7 +35,7 @@ using namespace Gudhi::Gudhi_stat;
int main( int argc , char** argv )
{
std::cout << "This program plot persistence landscape stored in a file (the file needs to be created beforehand). Please call the code with the name of a landsape file \n";
- Persistence_heat_maps l;
+ Persistence_heat_maps<constant_scaling_function> l;
l.load_from_file( argv[1] );
l.plot( argv[1] );
return 0;