View source: R/ripsFiltration.R
ripsFiltration | R Documentation |
The function ripsFiltration
computes the Rips filtration built on top of a point cloud.
ripsFiltration(
X, maxdimension, maxscale, dist = "euclidean",
library = "GUDHI", printProgress = FALSE)
X |
If |
maxdimension |
integer: max dimension of the homological features to be computed. (e.g. 0 for connected components, 1 for connected components and loops, 2 for connected components, loops, voids, etc.) |
maxscale |
number: maximum value of the rips filtration. |
dist |
|
library |
a string specifying which library to compute the Rips filtration. If |
printProgress |
logical: if |
For Rips filtration based on Euclidean distance of the input point cloud, the user can decide to use either the C++ library GUDHI or Dionysus. For Rips filtration based on arbitrary distance, the user can use the C++ library Dionysus. See refereneces.
The function ripsFiltration
returns a list with the following elements:
cmplx |
a list representing the complex. Its i-th element represents the vertices of i-th simplex. |
values |
a vector representing the filtration values. Its i-th element represents the filtration value of i-th simplex. |
increasing |
a logical variable indicating if the filtration values are in increasing order ( |
coordinates |
only if |
Jisu Kim
Maria C (2014). "GUDHI, Simplicial Complexes and Persistent Homology Packages." https://project.inria.fr/gudhi/software/.
Morozov D (2007). "Dionysus, a C++ library for computing persistent homology". https://www.mrzv.org/software/dionysus/
Edelsbrunner H, Harer J (2010). "Computational topology: an introduction." American Mathematical Society.
ripsDiag
, filtrationDiag
n <- 5
X <- cbind(cos(2*pi*seq_len(n)/n), sin(2*pi*seq_len(n)/n))
maxdimension <- 1
maxscale <- 1.5
FltRips <- ripsFiltration(X = X, maxdimension = maxdimension,
maxscale = maxscale, dist = "euclidean", library = "GUDHI",
printProgress = TRUE)
# plot rips filtration
lim <- rep(c(-1, 1), 2)
plot(NULL, type = "n", xlim = lim[1:2], ylim = lim[3:4],
main = "Rips Filtration Plot")
for (idx in seq(along = FltRips[["cmplx"]])) {
polygon(FltRips[["coordinates"]][FltRips[["cmplx"]][[idx]], , drop = FALSE],
col = "pink", border = NA, xlim = lim[1:2], ylim = lim[3:4])
}
for (idx in seq(along = FltRips[["cmplx"]])) {
polygon(FltRips[["coordinates"]][FltRips[["cmplx"]][[idx]], , drop = FALSE],
col = NULL, xlim = lim[1:2], ylim = lim[3:4])
}
points(FltRips[["coordinates"]], pch = 16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.