Class representing an element of the \( \mathbb{F}_p \) field for any prime number \( p \). 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 Shared_Zp_field_element::initialize method. More...
Public Types | |
using | element_type = Unsigned_integer_type |
using | characteristic_type = element_type |
Public Member Functions | |
Shared_Zp_field_element () | |
Default constructor. Sets the element to 0. | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Shared_Zp_field_element (Integer_type element) | |
Constructor setting the element to the given value. More... | |
Shared_Zp_field_element (const Shared_Zp_field_element &toCopy) | |
Copy constructor. More... | |
Shared_Zp_field_element (Shared_Zp_field_element &&toMove) noexcept | |
Move constructor. More... | |
element_type | get_value () const |
Returns the value of the element. More... | |
Shared_Zp_field_element & | operator= (Shared_Zp_field_element other) |
Assign operator. | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Shared_Zp_field_element & | operator= (const Integer_type &value) |
Assign operator. More... | |
operator unsigned int () const | |
Casts the element into an unsigned int. | |
Shared_Zp_field_element | get_inverse () const |
Returns the inverse of the element in the field. More... | |
std::pair< Shared_Zp_field_element, characteristic_type > | get_partial_inverse (characteristic_type productOfCharacteristics) const |
For interface purposes with multi-fields. Returns the inverse together with the argument. More... | |
Static Public Member Functions | |
static void | initialize (characteristic_type characteristic) |
Initialize the field to the given characteristic. Should be called first before constructing the field elements. More... | |
static Shared_Zp_field_element | get_additive_identity () |
Returns the additive identity of the field. More... | |
static Shared_Zp_field_element | get_multiplicative_identity () |
Returns the multiplicative identity of the field. More... | |
static Shared_Zp_field_element | get_partial_multiplicative_identity ([[maybe_unused]] characteristic_type productOfCharacteristics) |
For interface purposes with multi-fields. Returns the multiplicative identity of the field. More... | |
static characteristic_type | get_characteristic () |
Returns the current characteristic. More... | |
Friends | |
void | operator+= (Shared_Zp_field_element &f1, const Shared_Zp_field_element &f2) |
operator+= | |
Shared_Zp_field_element | operator+ (Shared_Zp_field_element f1, const Shared_Zp_field_element &f2) |
operator+ | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
void | operator+= (Shared_Zp_field_element &f, const Integer_type &v) |
operator+= More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Shared_Zp_field_element | operator+ (Shared_Zp_field_element f, const Integer_type &v) |
operator+ More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Integer_type | operator+ (const Integer_type &v, Shared_Zp_field_element f) |
operator+ More... | |
void | operator-= (Shared_Zp_field_element &f1, const Shared_Zp_field_element &f2) |
operator-= | |
Shared_Zp_field_element | operator- (Shared_Zp_field_element f1, const Shared_Zp_field_element &f2) |
operator- | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
void | operator-= (Shared_Zp_field_element &f, const Integer_type &v) |
operator-= More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Shared_Zp_field_element | operator- (Shared_Zp_field_element f, const Integer_type &v) |
operator- More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Integer_type | operator- (const Integer_type &v, const Shared_Zp_field_element &f) |
operator- More... | |
void | operator*= (Shared_Zp_field_element &f1, const Shared_Zp_field_element &f2) |
operator*= | |
Shared_Zp_field_element | operator* (Shared_Zp_field_element f1, const Shared_Zp_field_element &f2) |
operator* | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
void | operator*= (Shared_Zp_field_element &f, const Integer_type &v) |
operator*= More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Shared_Zp_field_element | operator* (Shared_Zp_field_element f, const Integer_type &v) |
operator* More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
Integer_type | operator* (const Integer_type &v, Shared_Zp_field_element f) |
operator* More... | |
bool | operator== (const Shared_Zp_field_element &f1, const Shared_Zp_field_element &f2) |
operator== | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
bool | operator== (const Integer_type &v, const Shared_Zp_field_element &f) |
operator== More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
bool | operator== (const Shared_Zp_field_element &f, const Integer_type &v) |
operator== More... | |
bool | operator!= (const Shared_Zp_field_element &f1, const Shared_Zp_field_element &f2) |
operator!= | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
bool | operator!= (const Integer_type &v, const Shared_Zp_field_element &f) |
operator!= More... | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
bool | operator!= (const Shared_Zp_field_element &f, const Integer_type &v) |
operator!= More... | |
void | swap (Shared_Zp_field_element &f1, Shared_Zp_field_element &f2) |
Swap operator. | |
Class representing an element of the \( \mathbb{F}_p \) field for any prime number \( p \). 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 Shared_Zp_field_element::initialize method.
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::Shared_Zp_field_element< Unsigned_integer_type, class >::characteristic_type = element_type |
Type for the field characteristic.
using Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::element_type = Unsigned_integer_type |
Type for the elements in the field.
|
inline |
Constructor setting the element to the given value.
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
element | Value of the element. |
|
inline |
Copy constructor.
toCopy | Element to copy. |
|
inlinenoexcept |
Move constructor.
toMove | Element to move. |
|
inlinestatic |
Returns the additive identity of the field.
|
inlinestatic |
Returns the current characteristic.
|
inline |
Returns the inverse of the element in the field.
|
inlinestatic |
Returns the multiplicative identity of the field.
|
inline |
For interface purposes with multi-fields. Returns the inverse together with the argument.
productOfCharacteristics | Some value. |
productOfCharacteristics
.
|
inlinestatic |
For interface purposes with multi-fields. Returns the multiplicative identity of the field.
productOfCharacteristics | Some value. |
|
inline |
Returns the value of the element.
|
inlinestatic |
Initialize the field to the given characteristic. Should be called first before constructing the field elements.
characteristic | Characteristic of the field. A positive prime number. |
|
inline |
Assign operator.
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator!=
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator!=
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator*
Integer_type | A native integer type. Should be able to contain the characteristic. if signed. |
|
friend |
operator*
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator*=
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator+
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator+
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator+=
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator-
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator-
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator-=
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator==
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |
|
friend |
operator==
Integer_type | A native integer type. Should be able to contain the characteristic if signed. |