A class implementing persistence landscapes data structures.
More...
|
std::ostream & | operator<< (std::ostream &out, Persistence_landscape &land) |
|
Persistence_landscape | add_two_landscapes (const Persistence_landscape &land1, const Persistence_landscape &land2) |
|
Persistence_landscape | subtract_two_landscapes (const Persistence_landscape &land1, const Persistence_landscape &land2) |
|
Persistence_landscape | operator+ (const Persistence_landscape &first, const Persistence_landscape &second) |
|
Persistence_landscape | operator- (const Persistence_landscape &first, const Persistence_landscape &second) |
|
Persistence_landscape | operator* (const Persistence_landscape &first, double con) |
|
Persistence_landscape | operator* (double con, const Persistence_landscape &first) |
|
double | compute_max_norm_distance_of_landscapes (const Persistence_landscape &first, const Persistence_landscape &second) |
|
double | compute_distance_of_landscapes (const Persistence_landscape &first, const Persistence_landscape &second, double p) |
|
double | compute_inner_product (const Persistence_landscape &l1, const Persistence_landscape &l2) |
|
A class implementing persistence landscapes data structures.
For theoretical description, please consult Statistical topological data analysis using persistence landscapes[12] , and for details of algorithms, A persistence landscapes toolbox for topological statistics[11].
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.
- Examples:
- Persistence_representations/persistence_landscape.cpp, Persistence_representations/persistence_landscapes/average_landscapes.cpp, Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp, Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp, Persistence_representations/persistence_landscapes/create_landscapes.cpp, and Persistence_representations/persistence_landscapes/plot_landscapes.cpp.
◆ Persistence_landscape() [1/3]
Gudhi::Persistence_representations::Persistence_landscape::Persistence_landscape |
( |
| ) |
|
|
inline |
◆ Persistence_landscape() [2/3]
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.
◆ Persistence_landscape() [3/3]
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.
◆ 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.
◆ compute_average()
void Gudhi::Persistence_representations::Persistence_landscape::compute_average |
( |
const std::vector< Persistence_landscape *> & |
to_average | ) |
|
|
inline |
◆ compute_integral_of_a_level_of_a_landscape()
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.
◆ compute_integral_of_landscape() [1/2]
double Gudhi::Persistence_representations::Persistence_landscape::compute_integral_of_landscape |
( |
| ) |
const |
◆ compute_integral_of_landscape() [2/2]
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)
◆ compute_maximum()
double Gudhi::Persistence_representations::Persistence_landscape::compute_maximum |
( |
| ) |
const |
|
inline |
◆ compute_scalar_product()
double Gudhi::Persistence_representations::Persistence_landscape::compute_scalar_product |
( |
const Persistence_landscape & |
second | ) |
const |
|
inline |
◆ compute_value_at_a_given_point()
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.
◆ distance()
double Gudhi::Persistence_representations::Persistence_landscape::distance |
( |
const Persistence_landscape & |
second, |
|
|
double |
power = 1 |
|
) |
| const |
|
inline |
◆ find_max()
double Gudhi::Persistence_representations::Persistence_landscape::find_max |
( |
unsigned |
lambda | ) |
const |
Compute maximal value of lambda-level landscape.
◆ get_y_range()
std::pair<double, double> Gudhi::Persistence_representations::Persistence_landscape::get_y_range |
( |
size_t |
level = 0 | ) |
const |
|
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).
◆ load_landscape_from_file()
void Gudhi::Persistence_representations::Persistence_landscape::load_landscape_from_file |
( |
const char * |
filename | ) |
|
◆ number_of_projections_to_R()
size_t Gudhi::Persistence_representations::Persistence_landscape::number_of_projections_to_R |
( |
| ) |
const |
|
inline |
◆ number_of_vectorize_functions()
size_t Gudhi::Persistence_representations::Persistence_landscape::number_of_vectorize_functions |
( |
| ) |
const |
|
inline |
This function return the number of functions that allows vectorization of persistence landscape. It is required in a concept Vectorized_topological_data.
◆ operator!=()
bool Gudhi::Persistence_representations::Persistence_landscape::operator!= |
( |
const Persistence_landscape & |
rhs | ) |
const |
|
inline |
An operator to compare two persistence landscapes.
◆ operator()()
double Gudhi::Persistence_representations::Persistence_landscape::operator() |
( |
unsigned |
level, |
|
|
double |
x |
|
) |
| const |
|
inline |
An operator to compute the value of a landscape in the level 'level' at the argument 'x'.
◆ operator*=()
Operator *=. The second parameter is a real number by which the y values of all landscape functions are multiplied. The x-values remain unchanged.
◆ operator+=()
Operator +=. The second parameter is persistence landscape.
◆ operator-=()
Operator -=. The second parameter is a persistence landscape.
◆ operator/=()
Operator /=. The second parameter is a real number.
◆ operator==()
bool Gudhi::Persistence_representations::Persistence_landscape::operator== |
( |
const Persistence_landscape & |
rhs | ) |
const |
An operator to compare two persistence landscapes.
◆ print_to_file()
void Gudhi::Persistence_representations::Persistence_landscape::print_to_file |
( |
const char * |
filename | ) |
const |
◆ project_to_R()
double Gudhi::Persistence_representations::Persistence_landscape::project_to_R |
( |
int |
number_of_function | ) |
const |
|
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.
◆ size()
size_t Gudhi::Persistence_representations::Persistence_landscape::size |
( |
| ) |
const |
|
inline |
Computes the number of landscape functions.
◆ vectorize()
std::vector<double> Gudhi::Persistence_representations::Persistence_landscape::vectorize |
( |
int |
number_of_function | ) |
const |
|
inline |
◆ add_two_landscapes
A function that compute sum of two landscapes.
◆ compute_distance_of_landscapes
Computations of \(L^{p}\) distance between two landscapes. p is the parameter of the procedure.
◆ compute_inner_product
Function to compute inner (scalar) product of two landscapes.
◆ compute_max_norm_distance_of_landscapes
Computations of \(L^{\infty}\) distance between two landscapes.
◆ operator* [1/2]
An operator * that allows multiplication of a landscape by a real number.
◆ operator* [2/2]
An operator * that allows multiplication of a landscape by a real number (order of parameters swapped).
◆ operator+
An operator +, that compute sum of two landscapes.
◆ operator-
An operator -, that compute difference of two landscapes.
◆ operator<<
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.
◆ subtract_two_landscapes
A function that compute difference of two landscapes.
The documentation for this class was generated from the following file: