Skip to content

Commit

Permalink
Merge pull request GUDHI#1108 from hschreiber/matrix_spelling
Browse files Browse the repository at this point in the history
[Persistence matrix] fix spelling errors
  • Loading branch information
mglisse authored Jul 12, 2024
2 parents c0b5ebb + 869c169 commit a89d8e8
Show file tree
Hide file tree
Showing 52 changed files with 403 additions and 398 deletions.
28 changes: 14 additions & 14 deletions src/Persistence_matrix/concept/PersistenceMatrixColumn.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using Chain_column_option = Chain_column_extra_properties;
/**
* @ingroup persistence_matrix
*
* @brief Concept of the column classes used by the @ref Matrix class. The classes the columns inheritates from
* @brief Concept of the column classes used by the @ref Matrix class. The classes the columns inherit from
* are either real or dummy classes, see @ref Row_access_option, @ref Column_dimension_option, @ref Chain_column_option.
* If used with column compression, the column type has to have its `std::hash` method.
*
Expand Down Expand Up @@ -81,7 +81,7 @@ class PersistenceMatrixColumn :
* @param colSettings Pointer to a setting structure or `nullptr`. The structure should contain all the necessary
* classes specific to the column type, such as custom allocators. The specificities are this way hidden behind
* a commun interface for all column types. If @p colSettings is not specified or is equal to `nullptr`, the column
* should still be constructable eventhough not necessarily "usable".
* should still be constructable even though not necessarily "usable".
*/
PersistenceMatrixColumn(Column_settings* colSettings = nullptr);
/**
Expand Down Expand Up @@ -291,7 +291,7 @@ class PersistenceMatrixColumn :
* @brief Returns a begin @ref Cell iterator to iterate over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell iterator.
*/
Expand All @@ -300,7 +300,7 @@ class PersistenceMatrixColumn :
* @brief Returns a begin @ref Cell const iterator to iterate over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell const iterator.
*/
Expand All @@ -309,7 +309,7 @@ class PersistenceMatrixColumn :
* @brief Returns a end @ref Cell iterator, iterating over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell iterator.
*/
Expand All @@ -318,7 +318,7 @@ class PersistenceMatrixColumn :
* @brief Returns a end @ref Cell const iterator, iterating over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell const iterator.
*/
Expand All @@ -327,7 +327,7 @@ class PersistenceMatrixColumn :
* @brief Returns a begin @ref Cell reverse iterator to iterate over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell reverse iterator.
*/
Expand All @@ -337,7 +337,7 @@ class PersistenceMatrixColumn :
* container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell const reverse iterator.
*/
Expand All @@ -346,7 +346,7 @@ class PersistenceMatrixColumn :
* @brief Returns a end @ref Cell reverse iterator, iterating over all cells contained in the underlying container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell reverse iterator.
*/
Expand All @@ -356,7 +356,7 @@ class PersistenceMatrixColumn :
* container.
*
* @warning The iterators really just iterate over the underlying container. Depending of the column type,
* neither the content nor the order is garanteed. See description of the actual Column class for more details.
* neither the content nor the order is guaranteed. See description of the actual Column class for more details.
*
* @return @ref Cell const reverse iterator.
*/
Expand Down Expand Up @@ -420,8 +420,8 @@ class PersistenceMatrixColumn :

/**
* @brief Equality comparator. Equal in the sense that what is "supposed" to be contained in the columns is equal,
* not what is actually stored in the underlying container. For exemple, the underlying container of
* @ref Vector_column can contain cells which were erased explicitely by @ref clear(index). Those cells should not
* not what is actually stored in the underlying container. For example, the underlying container of
* @ref Vector_column can contain cells which were erased explicitly by @ref clear(index). Those cells should not
* be taken into account while comparing.
*
* @param c1 First column to compare.
Expand All @@ -433,8 +433,8 @@ class PersistenceMatrixColumn :
/**
* @brief "Strictly smaller than" comparator. Usually a lexicographical order, but what matters is that the
* order is total. The order should apply on what is "supposed" to be contained in the columns,
* not what is actually stored in the underlying container. For exemple, the underlying container of
* @ref Vector_column can contain cells which were erased explicitely by @ref clear(index). Those cells should not
* not what is actually stored in the underlying container. For example, the underlying container of
* @ref Vector_column can contain cells which were erased explicitly by @ref clear(index). Those cells should not
* be taken into account while comparing.
*
* @param c1 First column to compare.
Expand Down
4 changes: 2 additions & 2 deletions src/Persistence_matrix/concept/PersistenceMatrixOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct PersistenceMatrixOptions
/**
* @brief Only enabled for @ref basematrix "base matrices" (i.e., none of the following is true:
* @ref has_column_pairings, @ref has_vine_update, @ref can_retrieve_representative_cycles), is ignored otherwise.
* If set to true, two identical columns in the matrix are not explicitely stored separately but are represented
* If set to true, two identical columns in the matrix are not explicitly stored separately but are represented
* by a same column.
*
* Note that some methods of the @ref basematrix "base matrix" are not available when true:
Expand Down Expand Up @@ -166,7 +166,7 @@ struct PersistenceMatrixOptions
// * the following is true: @ref has_column_pairings, @ref has_vine_update or
// * @ref can_retrieve_representative_cycles.
// * Is ignored otherwise
// * If set to true, the matrix is decomposed in several submatrices containing each all the
// * If set to true, the matrix is decomposed in several sub-matrices containing each all the
// * columns of same dimension.
// */
// static const bool is_separated_by_dimension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace persistence_fields {
*
* There are two types of classes:
* - those defining directly a field element, allowing to use them as any integer: the operators are overwritten such
* that the calculation is done in the field. For example, if \f$ e = 2 \f$ is an instanciation of an
* \f$ \mathbb{F}_3 \f$ element class, then `e + 3` returns an element instanciation of value `2`,
* that the calculation is done in the field. For example, if \f$ e = 2 \f$ is an instantiation of an
* \f$ \mathbb{F}_3 \f$ element class, then `e + 3` returns an element instantiation of value `2`,
* - those only defining the operators of a field or multi-field. They represent a collection of methods taking
* one or two integers as input and treating them as elements of the field. For example, if \f$ op \f$ is an
* instanciation of a \f$ \mathbb{F}_3 \f$ operator class, `op.add(2, 3)` returns `2`.
* instantiation of a \f$ \mathbb{F}_3 \f$ operator class, `op.add(2, 3)` returns `2`.
*
* The field operator classes all respect the @ref persistence_matrix::FieldOperators concept.
*
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 @@ -25,9 +25,9 @@ namespace persistence_matrix {
* and used as backend for persistence algorithms, such at persistent homology, @ref persistent_cohomology,
* or zigzag @cite zigzag.
*
* The structure is entirely accessed via the class @ref Matrix and it provides several functionnalities which can
* The structure is entirely accessed via the class @ref Matrix and it provides several functionalities which can
* be enabled or disabled through a template argument following the @ref PersistenceMatrixOptions concept.
* The main functionnalities are:
* 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
Expand Down
6 changes: 3 additions & 3 deletions src/Persistence_matrix/example/example_field_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void field_element_example(int ini){
std::cout << "e -= 4: " << e << "\n";
t = 4;
t -= e; //standard integer addition
std::cout << "4 -= e: " << t << " //standard integer substraction\n";
std::cout << "4 -= e: " << t << " //standard integer subtraction\n";
std::cout << "e * 6: " << (e * 6) << "\n";
std::cout << "6 * e: " << (6 * e) << "\n";
e *= 6;
Expand All @@ -57,8 +57,8 @@ void field_operator_example(const Field_operator& op){
std::cout << "Characteristic: " << op.get_characteristic() << "\n";
std::cout << "2 + 3: " << op.add(2u, 3u) << "\n";
std::cout << "3 + 2: " << op.add(3u, 2u) << "\n";
std::cout << "10 - 4: " << op.substract(10u, 4u) << "\n";
std::cout << "4 - 10: " << op.substract(4u, 10u) << "\n";
std::cout << "10 - 4: " << op.subtract(10u, 4u) << "\n";
std::cout << "4 - 10: " << op.subtract(4u, 10u) << "\n";
std::cout << "3 * 6: " << op.multiply(3u, 6u) << "\n";
std::cout << "6 * 3: " << op.multiply(6u, 3u) << "\n";
std::cout << "Value of 7: " << op.get_value(7u) << "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ void print_representative_cycles_example()
auto rc = mp.get_representative_cycles();
for (auto cycle : rc) {
// cycle[0] gives the row index of a simplex in the cycle
// because the simplices where indexed from 0 continously, the simplex represented by the row index cycle[0] is
// because the simplices where indexed from 0 continuously, the simplex represented by the row index cycle[0] is
// the same simplex represented by the column at position cycle[0] in RU
// that is why `mp.get_column_dimension(cycle[0])` gives us the dimension of the simplex for RU_matrix
//
// for the chain matrix, the row index will always represent a simplex ID. So,
// `mp.get_column_dimension(mp.get_column_with_pivot(cycle[0]))` will always work to get the dimension
// of the simplex. But in this particlar case, because of the simplex indexation and the fact that no swap
// occured, mp.get_column_with_pivot(cycle[0]) == cycle[0] and so `mp.get_column_dimension(cycle[0])` also works.
// of the simplex. But in this particular case, because of the simplex indexation and the fact that no swap
// occurred, mp.get_column_with_pivot(cycle[0]) == cycle[0] and so `mp.get_column_dimension(cycle[0])` also works.
std::cout << mp.get_column_dimension(cycle[0]);
std::cout << "-cycle: ";
for (auto index : cycle) {
Expand Down
2 changes: 1 addition & 1 deletion src/Persistence_matrix/example/simplex_tree_to_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void print_matrix(Base_matrix& bm, unsigned int size){

void print_matrix(const Chain_matrix& cm, unsigned int size){
std::cout << "Chain_matrix:\n";
// just note that if some vine swaps or removals occured, this would
// just note that if some vine swaps or removals occurred, this would
// not give us the columns in the order of filtration anymore, but just
// in the order they are stored in the matrix
for (unsigned int i = 0; i < size; ++i) {
Expand Down
20 changes: 10 additions & 10 deletions src/Persistence_matrix/include/gudhi/Fields/Multi_field_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace persistence_fields {
* @class Multi_field_operators Multi_field_operators.h gudhi/Fields/Multi_field_operators.h
* @ingroup persistence_fields
*
* @brief Class defining operators for a multi-field with "consecutive" charateristic range.
* @brief Class defining operators for a multi-field with "consecutive" characteristic range.
*/
class Multi_field_operators
{
Expand All @@ -46,7 +46,7 @@ class Multi_field_operators
* @brief Constructor setting the characteristics to all prime numbers between the two given integers.
*
* @param minCharacteristic Smallest value of a prime.
* @param maxCharacteristic Heighest value of a prime.
* @param maxCharacteristic Highest value of a prime.
*/
Multi_field_operators(int minCharacteristic, int maxCharacteristic)
: productOfAllCharacteristics_(0) //, multiplicativeID_(1)
Expand Down Expand Up @@ -81,7 +81,7 @@ class Multi_field_operators
* The characteristics will be all prime numbers in the given interval.
*
* @param minimum Smallest value of a prime.
* @param maximum Heighest value of a prime.
* @param maximum Highest value of a prime.
*/
void set_characteristic(int minimum, int maximum) {
if (maximum < 2) throw std::invalid_argument("Characteristic must be strictly positive");
Expand Down Expand Up @@ -184,36 +184,36 @@ class Multi_field_operators
}

/**
* @brief Returns the substraction in the field of the first element by the second element.
* @brief Returns the subtraction in the field of the first element by the second element.
*
* @param e1 First element.
* @param e2 Second element.
* @return `(e1 - e2) % productOfAllCharacteristics`, such that the result is positive.
*/
element_type substract(element_type e1, const element_type& e2) const {
substract_inplace_front(e1, e2);
element_type subtract(element_type e1, const element_type& e2) const {
subtract_inplace_front(e1, e2);
return e1;
}

/**
* @brief Stores in the first element the substraction in the field of the first element by the second element,
* @brief Stores in the first element the subtraction in the field of the first element by the second element,
* that is `(e1 - e2) % productOfAllCharacteristics`, such that the result is positive.
*
* @param e1 First element.
* @param e2 Second element.
*/
void substract_inplace_front(element_type& e1, const element_type& e2) const {
void subtract_inplace_front(element_type& e1, const element_type& e2) const {
e1 -= e2;
get_value_inplace(e1);
}
/**
* @brief Stores in the second element the substraction in the field of the first element by the second element,
* @brief Stores in the second element the subtraction in the field of the first element by the second element,
* that is `(e1 - e2) % productOfAllCharacteristics`, such that the result is positive.
*
* @param e1 First element.
* @param e2 Second element.
*/
void substract_inplace_back(const element_type& e1, element_type& e2) const {
void subtract_inplace_back(const element_type& e1, element_type& e2) const {
mpz_sub(e2.get_mpz_t(), e1.get_mpz_t(), e2.get_mpz_t());
get_value_inplace(e2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace persistence_fields {
* @class Shared_multi_field_element Multi_field_shared.h gudhi/Fields/Multi_field_shared.h
* @ingroup persistence_fields
*
* @brief Class representing an element of a multi-field. If each instanciation of the class can represent another
* element, they all share the same characteritics. That is if the characteristics are set for one, they will be
* set for all the others. The characteristics can be set before instianciating the elements with the static
* @brief Class representing an element of a multi-field. If each instantiation of the class can represent another
* element, they all share the same characteristics. That is if the characteristics are set for one, they will be
* set for all the others. The characteristics can be set before instantiating the elements with the static
* @ref Shared_multi_field_element::initialize method.
*/
class Shared_multi_field_element
Expand Down
10 changes: 5 additions & 5 deletions src/Persistence_matrix/include/gudhi/Fields/Multi_field_small.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Multi_field_element_with_small_characteristics {
*/
friend void operator-=(Multi_field_element_with_small_characteristics& f1,
Multi_field_element_with_small_characteristics const& f2) {
f1.element_ = _substract(f1.element_, f2.element_);
f1.element_ = _subtract(f1.element_, f2.element_);
}
/**
* @brief operator-
Expand All @@ -152,7 +152,7 @@ class Multi_field_element_with_small_characteristics {
*/
template <typename Integer_type, class = isInteger<Integer_type> >
friend void operator-=(Multi_field_element_with_small_characteristics& f, const Integer_type& v) {
f.element_ = _substract(f.element_, _get_value(v));
f.element_ = _subtract(f.element_, _get_value(v));
}
/**
* @brief operator-
Expand All @@ -172,7 +172,7 @@ class Multi_field_element_with_small_characteristics {
*/
template <typename Integer_type, class = isInteger<Integer_type> >
friend Integer_type operator-(const Integer_type& v, const Multi_field_element_with_small_characteristics& f) {
return _substract(_get_value(v), f.element_);
return _subtract(_get_value(v), f.element_);
}

/**
Expand Down Expand Up @@ -431,7 +431,7 @@ class Multi_field_element_with_small_characteristics {

return element;
}
static constexpr element_type _substract(element_type element, element_type v) {
static constexpr element_type _subtract(element_type element, element_type v) {
if (element < v) {
element += productOfAllCharacteristics_;
}
Expand All @@ -444,7 +444,7 @@ class Multi_field_element_with_small_characteristics {
int M = mod;
int A = element;
int y = 0, x = 1;
// extended euclidien division
// extended euclidean division
while (A > 1) {
int quotient = A / M;
int temp = M;
Expand Down
Loading

0 comments on commit a89d8e8

Please sign in to comment.