Skip to content

Commit

Permalink
merge Persistence_matrix update
Browse files Browse the repository at this point in the history
  • Loading branch information
hschreiber committed May 31, 2024
2 parents c192cd6 + 3773d2c commit cadfb5c
Show file tree
Hide file tree
Showing 37 changed files with 3,323 additions and 2,734 deletions.
45 changes: 23 additions & 22 deletions biblio/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,19 @@ @article{de2004topological
% V
%-----------------------------
@inproceedings{vineyards,
author = {David Cohen-Steiner and
Herbert Edelsbrunner and
Dmitriy Morozov},
title = {Vines and vineyards by updating persistence in linear time},
booktitle = {Symposium on Computational Geometry},
year = {2006},
pages = {119-126},
ee = {http://doi.acm.org/10.1145/1137856.1137877},
bibsource = {DBLP, http://dblp.uni-trier.de},
url = {https://doi.org/10.1145/1137856.1137877}
}

@inproceedings{cavanna15visualizing,
author = {Nicholas J. Cavanna and Mahmoodreza Jahanseir and Donald R. Sheehy},
booktitle = {Proceedings of the 31st International Symposium on Computational Geometry},
Expand Down Expand Up @@ -769,16 +782,16 @@ @article{DBLP:journals/focm/CarlssonS10
}

@inproceedings{zigzag,
author = {Cl{\'{e}}ment Maria and
Steve Y. Oudot},
title = {Zigzag Persistence via Reflections and Transpositions},
booktitle = {Proceedings of the Twenty-Sixth Annual {ACM-SIAM} Symposium on Discrete
Algorithms, {SODA} 2015, San Diego, CA, USA, January 4-6, 2015},
pages = {181--199},
publisher = {{SIAM}},
year = {2015},
url = {https://doi.org/10.1137/1.9781611973730.14},
doi = {10.1137/1.9781611973730.14}
author = {Cl{\'{e}}ment Maria and
Steve Y. Oudot},
title = {Zigzag Persistence via Reflections and Transpositions},
booktitle = {Proceedings of the Twenty-Sixth Annual {ACM-SIAM} Symposium on Discrete
Algorithms, {SODA} 2015, San Diego, CA, USA, January 4-6, 2015},
pages = {181--199},
publisher = {{SIAM}},
year = {2015},
url = {https://doi.org/10.1137/1.9781611973730.14},
doi = {10.1137/1.9781611973730.14}
}

%-----------------------------
Expand Down Expand Up @@ -1292,18 +1305,6 @@ @article{rips2012
pdf = {http://hal.archives-ouvertes.fr/hal-00785072/PDF/2012-cgta-Rips.pdf}
}

@inproceedings{DBLP:conf/compgeom/Cohen-SteinerEM06,
author = {David Cohen-Steiner and
Herbert Edelsbrunner and
Dmitriy Morozov},
title = {Vines and vineyards by updating persistence in linear time},
booktitle = {Symposium on Computational Geometry},
year = {2006},
pages = {119-126},
ee = {http://doi.acm.org/10.1145/1137856.1137877},
bibsource = {DBLP, http://dblp.uni-trier.de}
}

@inproceedings{DBLP:conf/compgeom/CarlssonSM09,
author = {Gunnar E. Carlsson and
Vin de Silva and
Expand Down
93 changes: 25 additions & 68 deletions src/Persistence_matrix/concept/FieldOperators.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class FieldOperators
*
* @param characteristic Prime number corresponding to the desired characteristic of the field.
*/
void set_characteristic(characteristic_type characteristic);
void set_characteristic(const characteristic_type& characteristic);
/**
* @brief Returns the current characteristic.
*
* @return The value of the current characteristic.
*/
characteristic_type get_characteristic() const;
const characteristic_type& get_characteristic() const;

/**
* @brief Returns the value of an integer in the field.
Expand All @@ -66,108 +66,65 @@ class FieldOperators
template <typename Integer_type>
element_type get_value(Integer_type e) const;

// void get_value(element_type& e) const;

/**
* @brief Returns the sum of two elements in the field.
* @brief Stores in the first element the sum of two given elements in the field, that is
* `(e1 + e2) % characteristic`, such that the result is positive.
*
* @param e1 First element.
* @param e2 Second element.
* @return `(e1 + e2) % characteristic`, such that the result is positive.
*/
element_type add(element_type e1, element_type e2) const;

// /**
// * @brief Returns the substraction in the field of the first element by the second element.
// *
// * @param e1 First element.
// * @param e2 Second element.
// * @return `(e1 - e2) % characteristic`, such that the result is positive.
// */
// element_type substract(element_type e1, element_type e2) const;
void add_inplace(element_type& e1, const element_type& e2) const;

/**
* @brief Returns the multiplication of two elements in the field.
* @brief Stores in the first element the multiplication of two given elements in the field,
* that is `(e1 * e2) % characteristic`, such that the result is positive.
*
* @param e1 First element.
* @param e2 Second element.
* @return `(e1 * e2) % characteristic`, such that the result is positive.
*/
element_type multiply(element_type e1, element_type e2) const;
void multiply_inplace(element_type& e1, const element_type& e2) const;

/**
* @brief Multiplies the first element with the second one and adds the third one. Returns the result in the field.
* @brief Multiplies the first element with the second one and adds the third one, that is
* `(e * m + a) % characteristic`, such that the result is positive. Stores the result in the first element.
*
* @param e First element.
* @param m Second element.
* @param a Third element.
* @return `(e * m + a) % characteristic`, such that the result is positive.
*/
element_type multiply_and_add(element_type e, element_type m, element_type a) const;

// /**
// * @brief Adds the first element to the second one and multiplies the third one with it.
// * Returns the result in the field.
// *
// * @param e First element.
// * @param a Second element.
// * @param m Third element.
// * @return `((e + a) * m) % characteristic`, such that the result is positive.
// */
// element_type add_and_multiply(element_type e, element_type a, element_type m) const;

// /**
// * @brief Returns true if the two given elements are equal in the field, false otherwise.
// *
// * @param e1 First element to compare.
// * @param e2 Second element to compare.
// * @return true If `e1 % characteristic == e2 % characteristic`.
// * @return false Otherwise.
// */
// bool are_equal(element_type e1, element_type e2) const;
void multiply_and_add_inplace_front(element_type& e, const element_type& m, const element_type& a) const;
/**
* @brief Multiplies the first element with the second one and adds the third one, that is
* `(e * m + a) % characteristic`, such that the result is positive. Stores the result in the third element.
*
* @param e First element.
* @param m Second element.
* @param a Third element.
*/
void multiply_and_add_inplace_back(const element_type& e, const element_type& m, element_type& a) const;

/**
* @brief Returns the inverse of the given element in the field.
*
* @param e Element to get the inverse from.
* @return Inverse in the current field of `e % characteristic`.
*/
element_type get_inverse(element_type e) const;
// /**
// * @brief In the case the field is a multi-field, returns the inverse of the given element in the fields
// * corresponding to the given sub-product of the product of all characteristics in the multi-field.
// * See @cite boissonnat:hal-00922572 for more details.
// * If the field is a usual field, simply returns the inverse in the field.
// *
// * @param e Element to get the inverse from.
// * @param productOfCharacteristics Product of the different characteristics to take into account in the
// * multi-field.
// * @return If a multi-field: pair of the inverse of @p e and the characteristic the inverse is coming from.
// * If a normal field: pair of the inverse of @p e and @p productOfCharacteristics.
// */
// std::pair<element_type, characteristic_type> get_partial_inverse(
// element_type e, characteristic_type productOfCharacteristics) const;
element_type get_inverse(const element_type& e) const;

/**
* @brief Returns the additive identity of the field.
*
* @return The additive identity of the field.
*/
static constexpr element_type get_additive_identity();
static const element_type& get_additive_identity();
/**
* @brief Returns the multiplicative identity of the field.
*
* @return The multiplicative identity of the field.
*/
static constexpr element_type get_multiplicative_identity();
// /**
// * @brief For multi-fields, returns the partial multiplicative identity of the field from the given product.
// * See @cite boissonnat:hal-00922572 for more details.
// * Otherwise, simply returns the multiplicative identity of the field.
// *
// * @param productOfCharacteristics Product of the different characteristics to take into account in the multi-field.
// * @return The partial multiplicative identity of the field
// */
// static constexpr element_type get_partial_multiplicative_identity(
// [[maybe_unused]] characteristic_type productOfCharacteristics);
static const element_type& get_multiplicative_identity();

/**
* @brief Assign operator.
Expand Down
Loading

0 comments on commit cadfb5c

Please sign in to comment.