summaryrefslogtreecommitdiff
path: root/src/Gudhi_stat/include/gudhi/persistence_representations
diff options
context:
space:
mode:
Diffstat (limited to 'src/Gudhi_stat/include/gudhi/persistence_representations')
-rw-r--r--src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_heat_maps.h41
-rw-r--r--src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape.h7
-rw-r--r--src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape_on_grid.h2
-rw-r--r--src/Gudhi_stat/include/gudhi/persistence_representations/Vector_distances_in_diagram.h5
4 files changed, 37 insertions, 18 deletions
diff --git a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_heat_maps.h b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_heat_maps.h
index d12f37fa..219349cb 100644
--- a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_heat_maps.h
+++ b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_heat_maps.h
@@ -113,14 +113,19 @@ std::vector< std::vector<double> > create_Gaussian_filter( size_t pixel_radius ,
}
+/*
+* There are various options to scale the poits depending on their location. One can for instance:
+* (1) do nothing (scale all of them with the weight 1), as in the function constant_function
+* (2) Scale them by the distance to the diagonal. This is implemented in function
+* (3) Scale them with the square of their distance to diagonal. This is implemented in function
+* (4) Scale them with
+*/
+
+
/**
- * There are various options to scale the poits depending on their location. One can for instance:
- * (1) do nothing (scale all of them with the weight 1), as in the function constant_function
- * (2) Scale them by the distance to the diagonal. This is implemented in function
- * (3) Scale them with the square of their distance to diagonal. This is implemented in function
- * (4) Scale them with
+ * This is one of a scaling functions used to weight poits depending on their persistence and/or location in the diagram.
+ * This particular functiona is a finction which always assign value 1 to a point in the diagram.
**/
-
class constant_scaling_function
{
public:
@@ -130,6 +135,11 @@ public:
}
};
+
+/**
+ * This is one of a scaling functions used to weight poits depending on their persistence and/or location in the diagram.
+ * The scaling given by this function to a point (b,d) is Euclidean distance of (b,d) from diagonal.
+**/
class distance_from_diagonal_scaling
{
public:
@@ -140,6 +150,10 @@ public:
}
};
+/**
+ * This is one of a scaling functions used to weight poits depending on their persistence and/or location in the diagram.
+ * The scaling given by this function to a point (b,d) is a square of Euclidean distance of (b,d) from diagonal.
+**/
class squared_distance_from_diagonal_scaling
{
public:
@@ -149,6 +163,10 @@ public:
}
};
+/**
+ * This is one of a scaling functions used to weight poits depending on their persistence and/or location in the diagram.
+ * The scaling given by this function to a point (b,d) is an arctan of a persistence of a point (i.e. arctan( b-d ).
+**/
class arc_tan_of_persistence_of_point
{
public:
@@ -158,6 +176,12 @@ public:
}
};
+/**
+ * This is one of a scaling functions used to weight poits depending on their persistence and/or location in the diagram.
+ * This scaling function do not only depend on a point (p,d) in the diagram, but it depends on the whole diagram.
+ * The longest persistence pair get a scaling 1. Any other pair get a scaling belong to [0,1], which is proportional
+ * to the persistence of that pair.
+**/
class weight_by_setting_maximal_interval_to_have_length_one
{
public:
@@ -327,10 +351,7 @@ public:
**/
void plot( const char* filename )const;
-
- /**
- * Binary (arythmetic) operation on two Persistence_heat_maps.
- **/
+
template<typename Operation_type>
friend Persistence_heat_maps operation_on_pair_of_heat_maps( const Persistence_heat_maps& first , const Persistence_heat_maps& second , Operation_type operation )
{
diff --git a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape.h b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape.h
index a0f8cbd2..9b968b01 100644
--- a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape.h
+++ b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape.h
@@ -128,7 +128,9 @@ public:
friend std::ostream& operator<<(std::ostream& out, Persistence_landscape& land );
-
+protected:
+ template < typename oper > friend Persistence_landscape operation_on_pair_of_landscapes ( const Persistence_landscape& land1 , const Persistence_landscape& land2 );
+public:
/**
@@ -521,8 +523,7 @@ protected:
void construct_persistence_landscape_from_barcode( const std::vector< std::pair< double , double > > & p );
Persistence_landscape multiply_lanscape_by_real_number_not_overwrite( double x )const;
- void multiply_lanscape_by_real_number_overwrite( double x );
- template < typename oper > friend Persistence_landscape operation_on_pair_of_landscapes ( const Persistence_landscape& land1 , const Persistence_landscape& land2 );
+ void multiply_lanscape_by_real_number_overwrite( double x );
friend double compute_maximal_distance_non_symmetric( const Persistence_landscape& pl1, const Persistence_landscape& pl2 );
void set_up_numbers_of_functions_for_vectorization_and_projections_to_reals()
diff --git a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape_on_grid.h b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape_on_grid.h
index 07e80447..422699ef 100644
--- a/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape_on_grid.h
+++ b/src/Gudhi_stat/include/gudhi/persistence_representations/Persistence_landscape_on_grid.h
@@ -415,7 +415,7 @@ public:
bool operator == ( const Persistence_landscape_on_grid& rhs )const
{
bool dbg = true;
- if ( ! this->values_of_landscapes.size() == rhs.values_of_landscapes.size() )
+ if ( this->values_of_landscapes.size() != rhs.values_of_landscapes.size() )
{
if (dbg) std::cerr << "values_of_landscapes of incompatable sizes\n";
return false;
diff --git a/src/Gudhi_stat/include/gudhi/persistence_representations/Vector_distances_in_diagram.h b/src/Gudhi_stat/include/gudhi/persistence_representations/Vector_distances_in_diagram.h
index 0e512bd3..83402d0f 100644
--- a/src/Gudhi_stat/include/gudhi/persistence_representations/Vector_distances_in_diagram.h
+++ b/src/Gudhi_stat/include/gudhi/persistence_representations/Vector_distances_in_diagram.h
@@ -281,10 +281,7 @@ public:
return std::make_pair( this->sorted_vector_of_distances[0] , 0);
}
- //arythmetic operations:
- /**
- * This is a generic function that allows to perform binary operations on two Vector_distances_in_diagram. It will be used later to defien sums and differences of Vector_distances_in_diagram.
- **/
+ //arythmetic operations:
template < typename Operation_type >
friend Vector_distances_in_diagram operation_on_pair_of_vectors( const Vector_distances_in_diagram& first , const Vector_distances_in_diagram& second , Operation_type opertion )
{