powered by
This helper function wraps Matrix::rankMatrix() to safely handle empty matrices (i.e., with 0 rows or columns).
Matrix::rankMatrix()
betti_number(simplices, bound_dim, tol = NULL)
An integer representing the rank of the matrix.
A list of simplices representing the simplicial complex.
The dimension of the boundary to compute the Betti number for.
Optional numerical tolerance to pass to rankMatrix().
rankMatrix()
simplices <- list(c(1, 2), c(3, 4), c(2, 1, 3), c(4, 2)) betti_number(simplices, 0, tol=0.1)
Run the code above in your browser using DataLab