Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Persistence matrix] renaming "complex faces" as "complex cells" #1136

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Persistence_matrix/concept/PersistenceMatrixColumn.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class PersistenceMatrixColumn :
PersistenceMatrixColumn(Column_settings* colSettings = nullptr);
/**
* @brief Constructs a column from the given range of @ref Matrix::Entry_representative. If the dimension is stored,
* the face is assumed to be simplicial and its dimension to be `nonZeroRowIndices length - 1` or `0`.
* the cell is assumed to be simplicial and its dimension to be `nonZeroRowIndices length - 1` or `0`.
* Otherwise, the dimension should be specified with another constructor.
*
* @tparam Container Range of @ref Matrix::Entry_representative. Assumed to have a %begin(), %end() and %size()
Expand All @@ -102,7 +102,7 @@ class PersistenceMatrixColumn :
/**
* @brief Constructs a column from the given range of @ref Matrix::Entry_representative such that the rows can be
* accessed. Each new entry in the column is also inserted in a row using @ref Row_access::insert_entry.
* If the dimension is stored, the face is assumed to be simplicial and its dimension to be
* If the dimension is stored, the cell is assumed to be simplicial and its dimension to be
* `nonZeroRowIndices length - 1` or `0`. Otherwise, the dimension should be specified with another constructor.
*
* @tparam Container Range of @ref Matrix::Entry_representative. Assumed to have a %begin(), %end() and %size()
Expand Down
8 changes: 4 additions & 4 deletions src/Persistence_matrix/concept/PersistenceMatrixOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ struct PersistenceMatrixOptions
* If set to false, the container is a std::vector. By default, it is recommended to set it to false, but some
* methods require it to be true to be enabled:
* - @ref Matrix::remove_column(Index) "remove_column(Index)" for @ref basematrix "base matrices",
* - @ref Matrix::remove_maximal_face(Index) "remove_maximal_face(Index)" for @ref chainmatrix "chain matrices",
* - @ref Matrix::remove_maximal_face(Index, const std::vector<Index>&)
* "remove_maximal_face(ID_index, const std::vector<ID_index>&)" for @ref chainmatrix "chain matrices",
* - @ref Matrix::remove_maximal_cell(Index) "remove_maximal_cell(Index)" for @ref chainmatrix "chain matrices",
* - @ref Matrix::remove_maximal_cell(Index, const std::vector<Index>&)
* "remove_maximal_cell(ID_index, const std::vector<ID_index>&)" for @ref chainmatrix "chain matrices",
* - @ref Matrix::remove_last "remove_last()" for @ref chainmatrix "chain matrices" if @ref has_vine_update is true.
*/
static const bool has_map_column_container;
/**
* @brief If set to true, enables the methods @ref Matrix::remove_maximal_face and @ref Matrix::remove_last,
* @brief If set to true, enables the methods @ref Matrix::remove_maximal_cell and @ref Matrix::remove_last,
* except for @ref basematrix "base matrices" when @ref has_column_compression is true.
*/
static const bool has_removable_columns;
Expand Down
4 changes: 2 additions & 2 deletions src/Persistence_matrix/doc/Intro_persistence_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace persistence_matrix {
* The main functionalities are:
* @li column and row access,
* @li column addition and scalar multiplication,
* @li removal of maximal faces while maintaining a valid reduced boundary matrix or compatible chain complex base
* @li removal of maximal cells while maintaining a valid reduced boundary matrix or compatible chain complex base
* and a valid barcode with respect to the new filtration,
* @li computation of persistent homology (but note that if the barcode is your only necessity, using the
* @ref persistent_cohomology module is often more performant),
* @li computation of representative cycles for the cycle classes,
* @li swapping of two consecutive faces in a filtration (cf. vineyards @cite vineyards) while maintaining a valid
* @li swapping of two consecutive cells in a filtration (cf. vineyards @cite vineyards) while maintaining a valid
* reduced boundary matrix or compatible chain complex base and a valid barcode with respect to the new filtration,
*
* \note Matrix API is in a beta version and may change in incompatible ways in the near future.
Expand Down
148 changes: 74 additions & 74 deletions src/Persistence_matrix/include/gudhi/Matrix.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace persistence_matrix {
*
* @brief %Matrix structure to store the ordered @ref boundarymatrix "boundary matrix" \f$ R \f$ of a filtered complex
* in order to compute its persistent homology. Provides an access to its columns and rows as well as the possibility
* to remove the last faces of the filtration while maintaining a valid barcode.
* to remove the last cells of the filtration while maintaining a valid barcode.
*
* @tparam Master_matrix An instantiation of @ref Matrix from which all types and options are deduced.
*/
Expand Down Expand Up @@ -120,10 +120,10 @@ class Boundary_matrix : public Master_matrix::Matrix_dimension_option,
/**
* @brief Inserts at the end of the matrix a new ordered column corresponding to the given boundary.
* This means that it is assumed that this method is called on boundaries in the order of the filtration.
* It also assumes that the faces in the given boundary are identified by their relative position in the filtration,
* It also assumes that the cells in the given boundary are identified by their relative position in the filtration,
* starting at 0. If it is not the case, use the other
* @ref insert_boundary(ID_index faceIndex, const Boundary_range& boundary, Dimension dim) "insert_boundary"
* instead by indicating the face ID used in the boundaries when the face is inserted.
* @ref insert_boundary(ID_index cellIndex, const Boundary_range& boundary, Dimension dim) "insert_boundary"
* instead by indicating the cell ID used in the boundaries when the cell is inserted.
*
* Different to the constructor, the boundaries do not have to come from a simplicial complex, but also from
* a more general entry complex. This includes cubical complexes or Morse complexes for example.
Expand All @@ -136,32 +136,32 @@ class Boundary_matrix : public Master_matrix::Matrix_dimension_option,
* @tparam Boundary_range Range of @ref Matrix::Entry_representative. Assumed to have a begin(), end() and size()
* method.
* @param boundary Boundary generating the new column. The content should be ordered by ID.
* @param dim Dimension of the face whose boundary is given. If the complex is simplicial,
* @param dim Dimension of the cell whose boundary is given. If the complex is simplicial,
* this parameter can be omitted as it can be deduced from the size of the boundary.
* @return The @ref MatIdx index of the inserted boundary.
*/
template <class Boundary_range = Boundary>
Index insert_boundary(const Boundary_range& boundary, Dimension dim = -1);
/**
* @brief It does the same as the other version, but allows the boundary faces to be identified without restrictions
* @brief It does the same as the other version, but allows the boundary cells to be identified without restrictions
* except that all IDs have to be strictly increasing in the order of filtration. Note that you should avoid then
* to use the other insertion method to avoid overwriting IDs.
*
* As a face has to be inserted before one of its cofaces in a valid filtration (recall that it is assumed that
* the faces are inserted by order of filtration), it is sufficient to indicate the ID of the face being inserted.
* As a cell has to be inserted before one of its cofaces in a valid filtration (recall that it is assumed that
* the cells are inserted by order of filtration), it is sufficient to indicate the ID of the cell being inserted.
*
* @tparam Boundary_range Range of @ref Matrix::Entry_representative. Assumed to have a begin(), end() and size()
* method.
* @param faceIndex @ref IDIdx index to use to identify the new face.
* @param cellIndex @ref IDIdx index to use to identify the new cell.
* @param boundary Boundary generating the new column. The indices of the boundary have to correspond to the
* @p faceIndex values of precedent calls of the method for the corresponding faces and should be ordered in
* @p cellIndex values of precedent calls of the method for the corresponding cells and should be ordered in
* increasing order.
* @param dim Dimension of the face whose boundary is given. If the complex is simplicial,
* @param dim Dimension of the cell whose boundary is given. If the complex is simplicial,
* this parameter can be omitted as it can be deduced from the size of the boundary.
* @return The @ref MatIdx index of the inserted boundary.
*/
template <class Boundary_range = Boundary>
Index insert_boundary(ID_index faceIndex, const Boundary_range& boundary, Dimension dim = -1);
Index insert_boundary(ID_index cellIndex, const Boundary_range& boundary, Dimension dim = -1);
/**
* @brief Returns the column at the given @ref MatIdx index.
* The type of the column depends on the choosen options, see @ref PersistenceMatrixOptions::column_type.
Expand Down Expand Up @@ -189,9 +189,9 @@ class Boundary_matrix : public Master_matrix::Matrix_dimension_option,
Row& get_row(Index rowIndex);
/**
* @brief Only available if @ref PersistenceMatrixOptions::has_removable_columns is true.
* Removes the last face in the filtration from the matrix and updates the barcode if this one was already computed.
* Removes the last cell in the filtration from the matrix and updates the barcode if this one was already computed.
*
* @return The pivot of the removed face.
* @return The pivot of the removed cell.
*/
Index remove_last();
/**
Expand Down Expand Up @@ -221,8 +221,8 @@ class Boundary_matrix : public Master_matrix::Matrix_dimension_option,
/**
* @brief Returns the dimension of the given column.
*
* @param columnIndex @ref MatIdx index of the column representing the face.
* @return Dimension of the face.
* @param columnIndex @ref MatIdx index of the column representing the cell.
* @return Dimension of the cell.
*/
Dimension get_column_dimension(Index columnIndex) const;

Expand Down Expand Up @@ -469,7 +469,7 @@ inline typename Boundary_matrix<Master_matrix>::Index Boundary_matrix<Master_mat
template <class Master_matrix>
template <class Boundary_range>
inline typename Boundary_matrix<Master_matrix>::Index Boundary_matrix<Master_matrix>::insert_boundary(
ID_index faceIndex, const Boundary_range& boundary, Dimension dim)
ID_index cellIndex, const Boundary_range& boundary, Dimension dim)
{
if (dim == -1) dim = boundary.size() == 0 ? 0 : boundary.size() - 1;

Expand All @@ -492,12 +492,12 @@ inline typename Boundary_matrix<Master_matrix>::Index Boundary_matrix<Master_mat
//row swap map containers
if constexpr (Master_matrix::Option_list::has_map_column_container) {
if constexpr (activeSwapOption) {
Swap_opt::indexToRow_.emplace(faceIndex, faceIndex);
Swap_opt::rowToIndex_.emplace(faceIndex, faceIndex);
Swap_opt::indexToRow_.emplace(cellIndex, cellIndex);
Swap_opt::rowToIndex_.emplace(cellIndex, cellIndex);
}
} else {
if constexpr (activeSwapOption) {
for (Index i = Swap_opt::indexToRow_.size(); i <= faceIndex; ++i) {
for (Index i = Swap_opt::indexToRow_.size(); i <= cellIndex; ++i) {
Swap_opt::indexToRow_.push_back(i);
Swap_opt::rowToIndex_.push_back(i);
}
Expand All @@ -506,10 +506,10 @@ inline typename Boundary_matrix<Master_matrix>::Index Boundary_matrix<Master_mat

//maps for possible shifting between column content and position indices used for birth events
if constexpr (activePairingOption){
if (faceIndex != nextInsertIndex_){
Pair_opt::idToPosition_.emplace(faceIndex, nextInsertIndex_);
if (cellIndex != nextInsertIndex_){
Pair_opt::idToPosition_.emplace(cellIndex, nextInsertIndex_);
if constexpr (Master_matrix::Option_list::has_removable_columns){
Pair_opt::PIDM::map_.emplace(nextInsertIndex_, faceIndex);
Pair_opt::PIDM::map_.emplace(nextInsertIndex_, cellIndex);
}
}
}
Expand Down
Loading
Loading