diff options
Diffstat (limited to 'src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h')
-rw-r--r-- | src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 2a4c8692..a12019f8 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -41,9 +41,7 @@ class Field_Zp { Field_Zp() : Prime(0), - inverse_(), - mult_id_all(1), - add_id_all(0) { + inverse_() { } void init(int charac) { @@ -81,14 +79,14 @@ class Field_Zp { } /** \brief Returns the additive idendity \f$0_{\Bbbk}\f$ of the field.*/ - const Element& additive_identity() const { - return add_id_all; + Element additive_identity() const { + return 0; } /** \brief Returns the multiplicative identity \f$1_{\Bbbk}\f$ of the field.*/ - const Element& multiplicative_identity(Element = 0) const { - return mult_id_all; + Element multiplicative_identity(Element = 0) const { + return 1; } - /** Returns the inverse in the field. Modifies P.*/ + /** Returns the inverse in the field. Modifies P. ??? */ std::pair<Element, Element> inverse(Element x, Element P) { return std::pair<Element, Element>(inverse_[x], P); } // <------ return the product of field characteristic for which x is invertible @@ -101,7 +99,7 @@ class Field_Zp { } /** \brief Returns the characteristic \f$p\f$ of the field.*/ - const int& characteristic() const { + int characteristic() const { return Prime; } @@ -109,8 +107,6 @@ class Field_Zp { int Prime; /** Property map Element -> Element, which associate to an element its inverse in the field.*/ std::vector<Element> inverse_; - const Element mult_id_all; - const Element add_id_all; }; } // namespace persistent_cohomology |