Loading...
Searching...
No Matches
Gudhi::Persistence_representations::Vector_distances_in_diagram< F > Class Template Reference
Persistence representations

A class implementing persistence vectors. More...

`#include <gudhi/Persistence_vectors.h>`

## Public Member Functions

| Vector_distances_in_diagram ()
| Vector_distances_in_diagram (const std::vector< std::pair< double, double > > &intervals, size_t where_to_cut)
| Vector_distances_in_diagram (const char *filename, size_t where_to_cut, unsigned dimension=std::numeric_limits< unsigned >::max())
double | vector_in_position (size_t position) const
size_t | size () const
void | write_to_file (const char *filename) const
void | print_to_file (const char *filename) const
void | load_from_file (const char *filename)
bool | operator== (const Vector_distances_in_diagram &second) 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< Vector_distances_in_diagram * > &to_average)
double | distance (const Vector_distances_in_diagram &second, double power=1) const
double | compute_scalar_product (const Vector_distances_in_diagram &second) const
std::vector< double > | output_for_visualization () const
void | plot (const char *filename) const
std::pair< double, double > | get_x_range () const
std::pair< double, double > | get_y_range () const
Vector_distances_in_diagram | multiply_by_scalar (double scalar) const
Vector_distances_in_diagram | operator* (double scalar)
Vector_distances_in_diagram | operator+= (const Vector_distances_in_diagram &rhs)
Vector_distances_in_diagram | operator-= (const Vector_distances_in_diagram &rhs)
Vector_distances_in_diagram | operator*= (double x)
Vector_distances_in_diagram | operator/= (double x)

## Friends

template<typename K>
std::ostream & | operator<< (std::ostream &out, const Vector_distances_in_diagram< K > &d)
Vector_distances_in_diagram | operator+ (const Vector_distances_in_diagram &first, const Vector_distances_in_diagram &second)
Vector_distances_in_diagram | operator- (const Vector_distances_in_diagram &first, const Vector_distances_in_diagram &second)
Vector_distances_in_diagram | operator* (double scalar, const Vector_distances_in_diagram &A)
Vector_distances_in_diagram | operator* (const Vector_distances_in_diagram &A, double scalar)

## Detailed Description

template<typename F>
class Gudhi::Persistence_representations::Vector_distances_in_diagram< F >

A class implementing persistence vectors.

This is an implementation of idea presented in the paper Stable Topological Signatures for Points on 3D Shapes [Carriere_Oudot_Ovsjanikov_top_signatures_3d] .
The parameter of the class is the class that computes distance used to construct the vectors. The typical function is either Euclidean of maximum (Manhattan) distance.

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

Examples
  persistence_vectors.cpp, persistence_vectors/average_persistence_vectors.cpp, persistence_vectors/compute_distance_of_persistence_vectors.cpp, persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp, persistence_vectors/create_persistence_vectors.cpp, and persistence_vectors/plot_persistence_vectors.cpp.

## Constructor & Destructor Documentation

## Vector_distances_in_diagram() [1/3]

template<typename F>

Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::Vector_distances_in_diagram | ( |  | ) |

inline

The default constructor.

## Vector_distances_in_diagram() [2/3]

template<typename F>

Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::Vector_distances_in_diagram | ( | const std::vector< std::pair< double, double > > & | intervals,
|  | size_t | where_to_cut )

The constructor that takes as an input a multiset of persistence intervals (given as vector of birth-death pairs). The second parameter is the desired length of the output vectors.

## Vector_distances_in_diagram() [3/3]

template<typename F>

Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::Vector_distances_in_diagram | ( | const char * | filename,
|  | size_t | where_to_cut,
|  | unsigned | dimension = std::numeric_limits<unsigned>::max() )

The constructor taking as an input a file with birth-death pairs. The second parameter is the desired length of the output vectors.

## Member Function Documentation

## compute_average()

template<typename F>

void Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::compute_average | ( | const std::vector< Vector_distances_in_diagram< F > * > & | to_average | ) |

Compute a average of two persistent vectors. This function is required by Topological_data_with_averages concept.

## compute_scalar_product()

template<typename F>

double Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::compute_scalar_product | ( | const Vector_distances_in_diagram< F > & | second | ) | const

Compute a scalar product of two persistent vectors. This function is required in Topological_data_with_scalar_product concept.

## distance()

template<typename F>

double Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::distance | ( | const Vector_distances_in_diagram< F > & | second,
|  | double | power = 1 ) const

Compute a distance of two persistent vectors. This function is required in Topological_data_with_distances concept. For max norm distance, set power to std::numeric_limits<double>::max()

## get_x_range()

template<typename F>

std::pair< double, double > Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::get_x_range | ( |  | ) | const

inline

The x-range of the persistence vector.

## get_y_range()

template<typename F>

std::pair< double, double > Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::get_y_range | ( |  | ) | const

inline

The y-range of the persistence vector.

## load_from_file()

template<typename F>

void Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::load_from_file | ( | const char * | filename | ) |

Loading a vector to a file.

## multiply_by_scalar()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::multiply_by_scalar | ( | double | scalar | ) | const

inline

This function implements an operation of multiplying Vector_distances_in_diagram by a scalar.

## number_of_projections_to_R()

template<typename F>

size_t Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::number_of_projections_to_R | ( |  | ) | const

inline

    The function gives the number of possible projections to R. This function is required by the

Real_valued_topological_data concept.

## number_of_vectorize_functions()

template<typename F>

size_t Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::number_of_vectorize_functions | ( |  | ) | const

inline

This function return the number of functions that allows vectorization of a persistence vector. It is required in a concept Vectorized_topological_data.

## operator*()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator* | ( | double | scalar | ) |

inline

This function computes a product of an object of a type Vector_distances_in_diagram with real number.

## operator*=()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator*= | ( | double | x | ) |

inline

*= operator for Vector_distances_in_diagram.

## operator+=()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator+= | ( | const Vector_distances_in_diagram< F > & | rhs | ) |

inline

+= operator for Vector_distances_in_diagram.

## operator-=()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator-= | ( | const Vector_distances_in_diagram< F > & | rhs | ) |

inline

-= operator for Vector_distances_in_diagram.

## operator/=()

template<typename F>

Vector_distances_in_diagram Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator/= | ( | double | x | ) |

inline

/= operator for Vector_distances_in_diagram.

## operator==()

template<typename F>

bool Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::operator== | ( | const Vector_distances_in_diagram< F > & | second | ) | const

inline

Comparison operators:

## output_for_visualization()

template<typename F>

std::vector< double > Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::output_for_visualization | ( |  | ) | const

inline

For visualization use output from vectorize and build histograms.

## plot()

template<typename F>

void Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::plot | ( | const char * | filename | ) | const

inline

Create a gnuplot script to visualize the data structure.

## print_to_file()

template<typename F>

void Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::print_to_file | ( | const char * | filename | ) | const

inline

Write a vector to a file.

## project_to_R()

template<typename F>

double Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::project_to_R | ( | int | number_of_function | ) | const

Compute projection to real numbers of persistence vector. 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()

template<typename F>

size_t Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::size | ( |  | ) | const

inline

Return a size of a vector.

## vector_in_position()

template<typename F>

double Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::vector_in_position | ( | size_t | position | ) | const

inline

This procedure gives the value of a vector on a given position.

## vectorize()

template<typename F>

std::vector< double > Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::vectorize | ( | int | number_of_function | ) | const

Compute a vectorization of a persistent vectors. It is required in a concept Vectorized_topological_data.

## write_to_file()

template<typename F>

void Gudhi::Persistence_representations::Vector_distances_in_diagram< F >::write_to_file | ( | const char * | filename | ) | const

Write a vector to a file.

## Friends And Related Symbol Documentation

## operator* [1/2]

template<typename F>

Vector_distances_in_diagram operator* | ( | const Vector_distances_in_diagram< F > & | A,
|  | double | scalar )

friend

This function computes a product of an object of a type Vector_distances_in_diagram with real number.

## operator* [2/2]

template<typename F>

Vector_distances_in_diagram operator* | ( | double | scalar,
|  | const Vector_distances_in_diagram< F > & | A )

friend

This function computes a product of an object of a type Vector_distances_in_diagram with real number.

## operator+

template<typename F>

Vector_distances_in_diagram operator+ | ( | const Vector_distances_in_diagram< F > & | first,
|  | const Vector_distances_in_diagram< F > & | second )

friend

This function computes a sum of two objects of a type Vector_distances_in_diagram.

## operator-

template<typename F>

Vector_distances_in_diagram operator- | ( | const Vector_distances_in_diagram< F > & | first,
|  | const Vector_distances_in_diagram< F > & | second )

friend

This function computes a difference of two objects of a type Vector_distances_in_diagram.

## operator<<

template<typename F>
template<typename K>

std::ostream & operator<< | ( | std::ostream & | out,
|  | const Vector_distances_in_diagram< K > & | d )

friend

Writing to a stream.

The documentation for this class was generated from the following file:

- include/gudhi/Persistence_vectors.h