A class implementing persistence landscapes data structures. More...
Public Member Functions | |
Persistence_landscape () | |
Persistence_landscape (const std::vector< std::pair< double, double > > &p, size_t number_of_levels=std::numeric_limits< size_t >::max()) | |
Persistence_landscape (const char *filename, size_t dimension=std::numeric_limits< unsigned >::max(), size_t number_of_levels=std::numeric_limits< size_t >::max()) | |
void | load_landscape_from_file (const char *filename) |
void | print_to_file (const char *filename) const |
double | compute_integral_of_landscape () const |
double | compute_integral_of_a_level_of_a_landscape (size_t level) const |
double | compute_integral_of_landscape (double p) const |
double | compute_value_at_a_given_point (unsigned level, double x) const |
Persistence_landscape | operator+= (const Persistence_landscape &rhs) |
Persistence_landscape | operator-= (const Persistence_landscape &rhs) |
Persistence_landscape | operator*= (double x) |
Persistence_landscape | operator/= (double x) |
bool | operator== (const Persistence_landscape &rhs) const |
bool | operator!= (const Persistence_landscape &rhs) const |
double | compute_maximum () const |
double | operator() (unsigned level, double x) const |
Persistence_landscape | abs () |
size_t | size () const |
double | find_max (unsigned lambda) const |
double | project_to_R (int number_of_function) const |
size_t | number_of_projections_to_R () const |
std::vector< double > | vectorize (int number_of_function) const |
size_t | number_of_vectorize_functions () const |
void | compute_average (const std::vector< Persistence_landscape * > &to_average) |
double | distance (const Persistence_landscape &second, double power=1) const |
double | compute_scalar_product (const Persistence_landscape &second) const |
std::pair< double, double > | get_y_range (size_t level=0) const |
A class implementing persistence landscapes data structures.
For theoretical description, please consult Statistical topological data analysis using persistence landscapes[bubenik_landscapes_2015] , and for details of algorithms, A persistence landscapes toolbox for topological statistics[bubenik_dlotko_landscapes_2016].
Persistence landscapes allow vectorization, computations of distances, computations of projections to Real, computations of averages and scalar products. Therefore they implement suitable interfaces. It implements the following concepts: Vectorized_topological_data, Topological_data_with_distances, Real_valued_topological_data, Topological_data_with_averages, Topological_data_with_scalar_product
Note that at the moment, due to rounding errors during the construction of persistence landscapes, elements which are different by 0.000005 are considered the same. If the scale in your persistence diagrams is comparable to this value, please rescale them before use this code.
|
inline |
Default constructor.
Gudhi::Persistence_representations::Persistence_landscape::Persistence_landscape | ( | const std::vector< std::pair< double, double > > & | p, |
size_t | number_of_levels = std::numeric_limits<size_t>::max() |
||
) |
Constructor that takes as an input a vector of birth-death pairs.
Gudhi::Persistence_representations::Persistence_landscape::Persistence_landscape | ( | const char * | filename, |
size_t | dimension = std::numeric_limits<unsigned>::max() , |
||
size_t | number_of_levels = std::numeric_limits<size_t>::max() |
||
) |
Constructor that reads persistence intervals from file and creates persistence landscape. The format of the
input file is the following: in each line we put birth-death pair. Last line is assumed to be empty. Even if the points within a line are not ordered, they will be ordered while the input is read.
Persistence_landscape Gudhi::Persistence_representations::Persistence_landscape::abs | ( | ) |
Function to compute absolute value of a PL function. The representation of persistence landscapes allow to store general PL-function. When computing distance between two landscapes, we compute difference between them. In this case, a general PL-function with negative value can appear as a result. Then in order to compute distance, we need to take its absolute value. This is the purpose of this procedure.
|
inline |
A function to compute averaged persistence landscape, based on vector of persistence landscapes. This function is required by Topological_data_with_averages concept.
double Gudhi::Persistence_representations::Persistence_landscape::compute_integral_of_a_level_of_a_landscape | ( | size_t | level | ) | const |
This function compute integral of the 'level'-level of a landscape.
double Gudhi::Persistence_representations::Persistence_landscape::compute_integral_of_landscape | ( | ) | const |
This function compute integral of the landscape (defined formally as sum of integrals on R of all landscape functions)
double Gudhi::Persistence_representations::Persistence_landscape::compute_integral_of_landscape | ( | double | p | ) | const |
This function compute integral of the landscape p-th power of a landscape (defined formally as sum of integrals
on R of p-th powers of all landscape functions)
|
inline |
Computations of maximum (y) value of landscape.
|
inline |
A function to compute scalar product of persistence landscapes. The parameter of this function is a Persistence_landscape. This function is required in Topological_data_with_scalar_product concept.
double Gudhi::Persistence_representations::Persistence_landscape::compute_value_at_a_given_point | ( | unsigned | level, |
double | x | ||
) | const |
A function that computes the value of a landscape at a given point. The parameters of the function are: unsigned level and double x. The procedure will compute the value of the level-landscape at the point x.
|
inline |
A function to compute distance between persistence landscape. The parameter of this function is a Persistence_landscape. This function is required in Topological_data_with_distances concept. For max norm distance, set power to std::numeric_limits<double>::max()
double Gudhi::Persistence_representations::Persistence_landscape::find_max | ( | unsigned | lambda | ) | const |
Compute maximal value of lambda-level landscape.
|
inline |
This procedure returns y-range of a given level persistence landscape. If a default value is used, the y-range of 0th level landscape is given (and this range contains the ranges of all other landscapes).
void Gudhi::Persistence_representations::Persistence_landscape::load_landscape_from_file | ( | const char * | filename | ) |
This procedure loads a landscape from file. It erase all the data that was previously stored in this landscape.
|
inline |
The function gives the number of possible projections to R. This function is required by the Real_valued_topological_data concept.
|
inline |
This function return the number of functions that allows vectorization of persistence landscape. It is required in a concept Vectorized_topological_data.
|
inline |
An operator to compare two persistence landscapes.
|
inline |
An operator to compute the value of a landscape in the level 'level' at the argument 'x'.
|
inline |
Operator *=. The second parameter is a real number by which the y values of all landscape functions are multiplied. The x-values remain unchanged.
|
inline |
Operator +=. The second parameter is persistence landscape.
|
inline |
Operator -=. The second parameter is a persistence landscape.
|
inline |
Operator /=. The second parameter is a real number.
bool Gudhi::Persistence_representations::Persistence_landscape::operator== | ( | const Persistence_landscape & | rhs | ) | const |
An operator to compare two persistence landscapes.
void Gudhi::Persistence_representations::Persistence_landscape::print_to_file | ( | const char * | filename | ) | const |
The procedure stores a landscape to a file. The file can be later used by a procedure load_landscape_from_file.
|
inline |
The number of projections to R is defined to the number of nonzero landscape functions. I-th projection is an integral of i-th landscape function over whole R. This function is required by the Real_valued_topological_data concept. At the moment this function is not tested, since it is quite likely to be changed in the future. Given this, when using it, keep in mind that it will be most likely changed in the next versions.
|
inline |
Computes the number of landscape functions.
|
inline |
This function produce a vector of doubles based on a landscape. It is required in a concept Vectorized_topological_data
|
friend |
A function that compute sum of two landscapes.
|
friend |
Computations of \(L^{p}\) distance between two landscapes. p is the parameter of the procedure.
|
friend |
Function to compute inner (scalar) product of two landscapes.
|
friend |
Computations of \(L^{\infty}\) distance between two landscapes.
|
friend |
An operator * that allows multiplication of a landscape by a real number.
|
friend |
An operator * that allows multiplication of a landscape by a real number (order of parameters swapped).
|
friend |
An operator +, that compute sum of two landscapes.
|
friend |
An operator -, that compute difference of two landscapes.
|
friend |
Writing landscape into a stream. A i-th level landscape starts with a string "lambda_i". Then the discontinuity points of the landscapes follows. Shall those points be joined with lines, we will obtain the i-th landscape function.
|
friend |
A function that compute difference of two landscapes.
GUDHIdev Version 3.5.0 - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding. - Copyright : MIT | Generated on Sun May 1 2022 09:19:32 for GUDHIdev by Doxygen 1.9.1 |