Class defining operators for the \( \mathbb{F}_p \) field for any prime number \( p \). More...
#include <gudhi/Fields/Zp_field_operators.h>
Public Types | |
| using | Element = Unsigned_integer_type |
| using | Characteristic = Element |
Public Member Functions | |
| Zp_field_operators (Characteristic characteristic=0) | |
| Default constructor. If a non-zero characteristic is given, initializes the field with it. The characteristic can later be changed again or initialized with set_characteristic. More... | |
| Zp_field_operators (const Zp_field_operators &toCopy) | |
| Copy constructor. More... | |
| Zp_field_operators (Zp_field_operators &&toMove) noexcept | |
| Move constructor. More... | |
| void | set_characteristic (Characteristic characteristic) |
| Sets the characteristic of the field. More... | |
| const Characteristic & | get_characteristic () const |
| Returns the current characteristic. More... | |
| Element | get_value (Element e) const |
| Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic. More... | |
| template<typename Signed_integer_type , class = isSignedInteger<Signed_integer_type>> | |
| Element | get_value (Signed_integer_type e) const |
| Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic. More... | |
| Element | add (Element e1, Element e2) const |
| Returns the sum of two elements in the field. More... | |
| void | add_inplace (Element &e1, Element e2) const |
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. More... | |
| Element | subtract (Element e1, Element e2) const |
| Returns the subtraction in the field of the first element by the second element. More... | |
| void | subtract_inplace_front (Element &e1, Element e2) const |
Stores in the first element the subtraction in the field of the first element by the second element, that is (e1 - e2) % 2, such that the result is positive. More... | |
| void | subtract_inplace_back (Element e1, Element &e2) const |
Stores in the second element the subtraction in the field of the first element by the second element, that is (e1 - e2) % 2, such that the result is positive. More... | |
| Element | multiply (Element e1, Element e2) const |
| Returns the multiplication of two elements in the field. More... | |
| void | multiply_inplace (Element &e1, Element e2) const |
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. More... | |
| Element | multiply_and_add (Element e, Element m, Element a) const |
| Multiplies the first element with the second one and adds the third one. Returns the result in the field. More... | |
| void | multiply_and_add_inplace_front (Element &e, Element m, Element a) const |
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. More... | |
| void | multiply_and_add_inplace_back (Element e, Element m, Element &a) const |
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. More... | |
| Element | add_and_multiply (Element e, Element a, Element m) const |
| Adds the first element to the second one and multiplies the third one with it. Returns the result in the field. More... | |
| void | add_and_multiply_inplace_front (Element &e, Element a, Element m) const |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % characteristic, such that the result is positive. Stores the result in the first element. More... | |
| void | add_and_multiply_inplace_back (Element e, Element a, Element &m) const |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % characteristic, such that the result is positive. Stores the result in the third element. More... | |
| bool | are_equal (Element e1, Element e2) const |
| Returns true if the two given elements are equal in the field, false otherwise. More... | |
| Element | get_inverse (Element e) const |
| Returns the inverse of the given element in the field. More... | |
| std::pair< Element, Characteristic > | get_partial_inverse (Element e, Characteristic productOfCharacteristics) const |
| For interface purposes with multi-fields. Returns the inverse together with the second argument. More... | |
| Zp_field_operators & | operator= (Zp_field_operators other) |
| Assign operator. | |
Static Public Member Functions | |
| static constexpr Element | get_additive_identity () |
| Returns the additive identity of the field. More... | |
| static constexpr Element | get_multiplicative_identity () |
| Returns the multiplicative identity of the field. More... | |
| static constexpr Element | get_partial_multiplicative_identity (Characteristic productOfCharacteristics) |
| For interface purposes with multi-fields. Returns the multiplicative identity of the field. More... | |
Friends | |
| void | swap (Zp_field_operators &f1, Zp_field_operators &f2) |
| Swap operator. | |
Class defining operators for the \( \mathbb{F}_p \) field for any prime number \( p \).
| Unsigned_integer_type | A native unsigned integer type: unsigned int, long unsigned int, etc. Will be used as the field element type. |
| using Gudhi::persistence_fields::Zp_field_operators< Unsigned_integer_type, class >::Characteristic = Element |
Type for the field characteristic.
| using Gudhi::persistence_fields::Zp_field_operators< Unsigned_integer_type, class >::Element = Unsigned_integer_type |
Type for the elements in the field.
|
inline |
Default constructor. If a non-zero characteristic is given, initializes the field with it. The characteristic can later be changed again or initialized with set_characteristic.
| characteristic | Prime number corresponding to the desired characteristic of the field. |
|
inline |
Copy constructor.
| toCopy | Operators to copy. |
|
inlinenoexcept |
Move constructor.
| toMove | Operators to move. |
|
inline |
Returns the sum of two elements in the field.
| e1 | First element. |
| e2 | Second element. |
(e1 + e2) % characteristic, such that the result is positive.
|
inline |
Adds the first element to the second one and multiplies the third one with it. Returns the result in the field.
| e | First element. |
| a | Second element. |
| m | Third element. |
((e + a) * m) % characteristic, such that the result is positive.
|
inline |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % characteristic, such that the result is positive. Stores the result in the third element.
| e | First element. |
| a | Second element. |
| m | Third element. |
|
inline |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % characteristic, such that the result is positive. Stores the result in the first element.
| e | First element. |
| a | Second element. |
| m | Third element. |
|
inline |
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.
| e1 | First element. |
| e2 | Second element. |
|
inline |
Returns true if the two given elements are equal in the field, false otherwise.
| e1 | First element to compare. |
| e2 | Second element to compare. |
e1 % characteristic == e2 % characteristic.
|
inlinestaticconstexpr |
Returns the additive identity of the field.
|
inline |
Returns the current characteristic.
|
inline |
Returns the inverse of the given element in the field.
| e | Element to get the inverse from. |
e % characteristic.
|
inlinestaticconstexpr |
Returns the multiplicative identity of the field.
|
inline |
For interface purposes with multi-fields. Returns the inverse together with the second argument.
| e | Element to get the inverse from. |
| productOfCharacteristics | Some value. |
e and the second element is productOfCharacteristics.
|
inlinestaticconstexpr |
For interface purposes with multi-fields. Returns the multiplicative identity of the field.
| productOfCharacteristics | Some value. |
|
inline |
Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic.
| e | Unsigned integer to return the value from. |
e modulo the current characteristic, such that the result is positive.
|
inline |
Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic.
| Signed_integer_type | A native signed integer type: int, long int, etc. |
| e | Integer to return the value from. |
e modulo the current characteristic, such that the result is positive.
|
inline |
Returns the multiplication of two elements in the field.
| e1 | First element. |
| e2 | Second element. |
(e1 * e2) % characteristic, such that the result is positive.
|
inline |
Multiplies the first element with the second one and adds the third one. Returns the result in the field.
| e | First element. |
| m | Second element. |
| a | Third element. |
(e * m + a) % characteristic, such that the result is positive.
|
inline |
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.
| e | First element. |
| m | Second element. |
| a | Third element. |
|
inline |
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.
| e | First element. |
| m | Second element. |
| a | Third element. |
|
inline |
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.
| e1 | First element. |
| e2 | Second element. |
|
inline |
Sets the characteristic of the field.
| characteristic | Prime number corresponding to the desired characteristic of the field. |
|
inline |
Returns the subtraction in the field of the first element by the second element.
| e1 | First element. |
| e2 | Second element. |
(e1 - e2) % characteristic, such that the result is positive.
|
inline |
Stores in the second element the subtraction in the field of the first element by the second element, that is (e1 - e2) % 2, such that the result is positive.
| e1 | First element. |
| e2 | Second element. |
|
inline |
Stores in the first element the subtraction in the field of the first element by the second element, that is (e1 - e2) % 2, such that the result is positive.
| e1 | First element. |
| e2 | Second element. |