Loading...
Searching...
No Matches
Gudhi::cover_complex::Cover_complex< Point > Class Template Reference
Cover complex

Cover complex data structure. More...

`#include <include/gudhi/GIC.h>`

## Public Member Functions

void | set_type (const std::string &t)
| Specifies whether the type of the output simplicial complex.
void | set_verbose (bool verb=false)
| Specifies whether the program should display information or not.
void | set_subsampling (double constant, double power)
| Sets the constants used to subsample the data set. These constants are explained in [Carriere17c].
void | set_mask (int nodemask)
| Sets the mask, which is a threshold integer such that nodes in the complex that contain a number of data points which is less than or equal to this threshold are not displayed.
void | set_point_cloud_from_range (const std::vector< std::vector< double > > &point_cloud)
| Reads and stores the input point cloud from vector stored in memory.
bool | read_point_cloud (const std::string &off_file_name)
| Reads and stores the input point cloud from .(n)OFF file.
void | set_graph_from_file (const std::string &graph_file_name)
| Creates a graph G from a file containing the edges.
void | set_graph_from_OFF ()
| Creates a graph G from the triangulation given by the input .OFF file.
template<typename Distance>
void | set_graph_from_rips (double threshold, Distance distance)
| Creates a graph G from a Rips complex.
void | set_distances_from_range (const std::vector< std::vector< double > > &distance_matrix)
| Reads and stores the distance matrices from vector stored in memory.
template<typename Distance>
double | set_graph_from_automatic_rips (Distance distance, int N=100)
| Creates a graph G from a Rips complex whose threshold value is automatically tuned with subsampling—see [Carriere17c].
void | set_function_from_file (const std::string &func_file_name)
| Creates the function f from a file containing the function values.
void | set_function_from_coordinate (int k)
| Creates the function f from the k-th coordinate of the point cloud P.
template<class InputRange>
void | set_function_from_range (InputRange const &function)
| Creates the function f from a vector stored in memory.
double | set_automatic_resolution ()
| Computes the optimal length of intervals (i.e. the smallest interval length avoiding discretization artifacts—see [Carriere17c]) for a functional cover.
void | set_resolution_with_interval_length (double reso)
| Sets a length of intervals from a value stored in memory.
void | set_resolution_with_interval_number (int reso)
| Sets a number of intervals from a value stored in memory.
void | set_gain (double g=0.3)
| Sets a gain from a value stored in memory (default value 0.3).
void | set_cover_from_function ()
| Creates a cover C from the preimages of the function f.
void | set_cover_from_file (const std::string &cover_file_name)
| Creates the cover C from a file containing the cover elements of each point (the order has to be the same as in the input file!).
template<class AssignmentRange>
void | set_cover_from_range (AssignmentRange const &assignments)
| Creates the cover C from a vector of assignments stored in memory. The assignments, or clusters IDs, are vectors of integers.
template<typename Distance>
void | set_cover_from_Voronoi (Distance distance, int m=100)
| Creates the cover C from the Voronoï cells of a subsampling of the point cloud.
const std::vector< int > & | subpopulation (int c)
| Returns the data subset corresponding to a specific node of the created complex.
double | subcolor (int c)
| Returns the mean color corresponding to a specific node of the created complex.
void | set_color_from_file (const std::string &color_file_name)
| Computes the function used to color the nodes of the simplicial complex from a file containing the function values.
void | set_color_from_coordinate (int k=0)
| Computes the function used to color the nodes of the simplicial complex from the k-th coordinate.
void | set_color_from_range (std::vector< double > color)
| Computes the function used to color the nodes of the simplicial complex from a vector stored in memory.
void | plot_DOT ()
| Creates a .dot file called SC.dot for neato (part of the graphviz package) once the simplicial complex is computed to get a visualization of its 1-skeleton in a .pdf file.
void | write_info ()
| Creates a .txt file called SC.txt describing the 1-skeleton, which can then be plotted with e.g. KeplerMapper.
void | plot_OFF ()
| Creates a .off file called SC.off for 3D visualization, which contains the 2-skeleton of the GIC. This function assumes that the cover has been computed with Voronoi. If data points are in 1D or 2D, the remaining coordinates of the points embedded in 3D are set to 0.
Persistence_diagram | compute_PD ()
| Computes the extended persistence diagram of the complex.
void | compute_distribution (unsigned int N=100)
| Computes bootstrapped distances distribution.
double | compute_distance_from_confidence_level (double alpha)
| Computes the bottleneck distance threshold corresponding to a specific confidence level.
double | compute_confidence_level_from_distance (double d)
| Computes the confidence level of a specific bottleneck distance threshold.
double | compute_p_value ()
| Computes the p-value, i.e. the opposite of the confidence level of the largest bottleneck distance preserving the points in the persistence diagram of the output simplicial complex.
template<typename SimplicialComplex>
void | create_complex (SimplicialComplex &complex)
| Creates the simplicial complex.
void | find_simplices ()
| Computes the simplices of the simplicial complex.

## Detailed Description

template<typename Point>
class Gudhi::cover_complex::Cover_complex< Point >

Cover complex data structure.

The data structure is a simplicial complex, representing a Graph Induced simplicial Complex (GIC) or a Nerve, and whose simplices are computed with a cover C of a point cloud P, which often comes from the preimages of intervals covering the image of a function f defined on P. These intervals are parameterized by their resolution (either their length or their number) and their gain (percentage of overlap). To compute a GIC, one also needs a graph G built on top of P, whose cliques with vertices belonging to different elements of C correspond to the simplices of the GIC.

Examples
  CoordGIC.cpp, FuncGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## Member Function Documentation

## compute_confidence_level_from_distance()

template<typename Point>

double Gudhi::cover_complex::Cover_complex< Point >::compute_confidence_level_from_distance | ( | double | d | ) |

inline

Computes the confidence level of a specific bottleneck distance threshold.

Parameters

  [in] | d | Bottleneck distance.

## compute_distance_from_confidence_level()

template<typename Point>

double Gudhi::cover_complex::Cover_complex< Point >::compute_distance_from_confidence_level | ( | double | alpha | ) |

inline

Computes the bottleneck distance threshold corresponding to a specific confidence level.

Parameters

  [in] | alpha | Confidence level.

## compute_distribution()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::compute_distribution | ( | unsigned int | N = 100 | ) |

inline

Computes bootstrapped distances distribution.

Parameters

  [in] | N | number of bootstrap iterations.

Examples
  CoordGIC.cpp.

## create_complex()

template<typename Point>
template<typename SimplicialComplex>

void Gudhi::cover_complex::Cover_complex< Point >::create_complex | ( | SimplicialComplex & | complex | ) |

inline

Creates the simplicial complex.

Parameters

  [in] | complex | SimplicialComplex to be created.

Examples
  CoordGIC.cpp, FuncGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## read_point_cloud()

template<typename Point>

bool Gudhi::cover_complex::Cover_complex< Point >::read_point_cloud | ( | const std::string & | off_file_name | ) |

inline

Reads and stores the input point cloud from .(n)OFF file.

Parameters

  [in] | off_file_name | name of the input .OFF or .nOFF file.

Examples
  CoordGIC.cpp, FuncGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## set_automatic_resolution()

template<typename Point>

double Gudhi::cover_complex::Cover_complex< Point >::set_automatic_resolution | ( |  | ) |

inline

Computes the optimal length of intervals (i.e. the smallest interval length avoiding discretization artifacts—see [Carriere17c]) for a functional cover.

Returns
  reso interval length used to compute the cover.

Examples
  CoordGIC.cpp, and FuncGIC.cpp.

## set_color_from_coordinate()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_color_from_coordinate | ( | int | k = 0 | ) |

inline

Computes the function used to color the nodes of the simplicial complex from the k-th coordinate.

Parameters

  [in] | k | coordinate to use (start at 0).

Examples
  CoordGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## set_color_from_file()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_color_from_file | ( | const std::string & | color_file_name | ) |

inline

Computes the function used to color the nodes of the simplicial complex from a file containing the function values.

Parameters

  [in] | color_file_name | name of the input color file.

Examples
  FuncGIC.cpp.

## set_color_from_range()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_color_from_range | ( | std::vector< double > | color | ) |

inline

Computes the function used to color the nodes of the simplicial complex from a vector stored in memory.

Parameters

  [in] | color | input vector of values.

## set_cover_from_file()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_cover_from_file | ( | const std::string & | cover_file_name | ) |

inline

Creates the cover C from a file containing the cover elements of each point (the order has to be the same as in the input file!).

Parameters

  [in] | cover_file_name | name of the input cover file.

## set_cover_from_range()

template<typename Point>
template<class AssignmentRange>

void Gudhi::cover_complex::Cover_complex< Point >::set_cover_from_range | ( | AssignmentRange const & | assignments | ) |

inline

Creates the cover C from a vector of assignments stored in memory. The assignments, or clusters IDs, are vectors of integers.

Template Parameters

  AssignmentRange | random access range of input ranges of integers.

Parameters

  [in] | assignments | the cover assignments, specifying for each point the list of clusters it belongs to.

## set_cover_from_Voronoi()

template<typename Point>
template<typename Distance>

void Gudhi::cover_complex::Cover_complex< Point >::set_cover_from_Voronoi | ( | Distance | distance,
|  | int | m = 100 )

inline

Creates the cover C from the Voronoï cells of a subsampling of the point cloud.

Parameters

  [in] | distance | distance between the points.
  [in] | m | number of points in the subsample.

Examples
  VoronoiGIC.cpp.

## set_distances_from_range()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_distances_from_range | ( | const std::vector< std::vector< double > > & | distance_matrix | ) |

inline

Reads and stores the distance matrices from vector stored in memory.

Parameters

  [in] | distance_matrix | input vector representing the distance matrix.

## set_function_from_coordinate()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_function_from_coordinate | ( | int | k | ) |

inline

Creates the function f from the k-th coordinate of the point cloud P.

Parameters

  [in] | k | coordinate to use (start at 0).

Examples
  CoordGIC.cpp, and Nerve.cpp.

## set_function_from_file()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_function_from_file | ( | const std::string & | func_file_name | ) |

inline

Creates the function f from a file containing the function values.

Parameters

  [in] | func_file_name | name of the input function file.

Examples
  FuncGIC.cpp.

## set_function_from_range()

template<typename Point>
template<class InputRange>

void Gudhi::cover_complex::Cover_complex< Point >::set_function_from_range | ( | InputRange const & | function | ) |

inline

Creates the function f from a vector stored in memory.

Parameters

  [in] | function | input vector of values.

## set_gain()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_gain | ( | double | g = 0.3 | ) |

inline

Sets a gain from a value stored in memory (default value 0.3).

Parameters

  [in] | g | gain.

Examples
  CoordGIC.cpp, FuncGIC.cpp, and Nerve.cpp.

## set_graph_from_automatic_rips()

template<typename Point>
template<typename Distance>

double Gudhi::cover_complex::Cover_complex< Point >::set_graph_from_automatic_rips | ( | Distance | distance,
|  | int | N = 100 )

inline

Creates a graph G from a Rips complex whose threshold value is automatically tuned with subsampling—see [Carriere17c].

Parameters

  [in] | distance | distance between data points.
  [in] | N | number of subsampling iteration (the default reasonable value is 100, but there is no guarantee on how to choose it).

Returns
  delta threshold used for computing the Rips complex.

Examples
  CoordGIC.cpp, and FuncGIC.cpp.

## set_graph_from_file()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_graph_from_file | ( | const std::string & | graph_file_name | ) |

inline

Creates a graph G from a file containing the edges.

Parameters

  [in] | graph_file_name | name of the input graph file. The graph file contains one edge per line, each edge being represented by the IDs of its two nodes.

## set_graph_from_rips()

template<typename Point>
template<typename Distance>

void Gudhi::cover_complex::Cover_complex< Point >::set_graph_from_rips | ( | double | threshold,
|  | Distance | distance )

inline

Creates a graph G from a Rips complex.

Parameters

  [in] | threshold | threshold value for the Rips complex.
  [in] | distance | distance used to compute the Rips complex.

## set_mask()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_mask | ( | int | nodemask | ) |

inline

Sets the mask, which is a threshold integer such that nodes in the complex that contain a number of data points which is less than or equal to this threshold are not displayed.

Parameters

  [in] | nodemask | integer.

## set_point_cloud_from_range()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_point_cloud_from_range | ( | const std::vector< std::vector< double > > & | point_cloud | ) |

inline

Reads and stores the input point cloud from vector stored in memory.

Parameters

  [in] | point_cloud | input vector representing the point cloud. Each row is a point and each coordinate is a vector.

## set_resolution_with_interval_length()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_resolution_with_interval_length | ( | double | reso | ) |

inline

Sets a length of intervals from a value stored in memory.

Parameters

  [in] | reso | length of intervals.

## set_resolution_with_interval_number()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_resolution_with_interval_number | ( | int | reso | ) |

inline

Sets a number of intervals from a value stored in memory.

Parameters

  [in] | reso | number of intervals.

Examples
  Nerve.cpp.

## set_subsampling()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_subsampling | ( | double | constant,
|  | double | power )

inline

Sets the constants used to subsample the data set. These constants are explained in [Carriere17c].

Parameters

  [in] | constant | double.
  [in] | power | double.

## set_type()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_type | ( | const std::string & | t | ) |

inline

Specifies whether the type of the output simplicial complex.

Parameters

  [in] | t | std::string (either "GIC" or "Nerve").

Examples
  CoordGIC.cpp, FuncGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## set_verbose()

template<typename Point>

void Gudhi::cover_complex::Cover_complex< Point >::set_verbose | ( | bool | verb = false | ) |

inline

Specifies whether the program should display information or not.

Parameters

  [in] | verb | boolean (true = display info, false = do not display info).

Examples
  CoordGIC.cpp, FuncGIC.cpp, Nerve.cpp, and VoronoiGIC.cpp.

## subcolor()

template<typename Point>

double Gudhi::cover_complex::Cover_complex< Point >::subcolor | ( | int | c | ) |

inline

Returns the mean color corresponding to a specific node of the created complex.

Parameters

  [in] | c | ID of the node.

Returns
  cover_color(c) mean color value.

## subpopulation()

template<typename Point>

const std::vector< int > & Gudhi::cover_complex::Cover_complex< Point >::subpopulation | ( | int | c | ) |

inline

Returns the data subset corresponding to a specific node of the created complex.

Parameters

  [in] | c | ID of the node.

Returns
  cover_back(c) vector of IDs of data points.

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

- include/gudhi/GIC.h