Class defining operators for the \( \mathbb{F}_2 \) field. More...
#include <gudhi/Fields/Z2_field_operators.h>
Public Types | |
using | Element = bool |
using | Characteristic = unsigned int |
Public Member Functions | |
Z2_field_operators () | |
Default constructor. | |
Static Public Member Functions | |
static constexpr Characteristic | get_characteristic () |
Returns the characteristic of the field, that is 2 . | |
template<typename Integer_type , class = isInteger<Integer_type>> | |
static Element | get_value (Integer_type e) |
Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | add (Unsigned_integer_type e1, Unsigned_integer_type e2) |
Returns the sum of two elements in the field. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | add_inplace (Unsigned_integer_type &e1, Unsigned_integer_type e2) |
Stores in the first element the sum of two given elements in the field, that is (e1 + e2) % 2 , such that the result is positive. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | subtract (Unsigned_integer_type e1, Unsigned_integer_type e2) |
Returns the subtraction in the field of the first element by the second element. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | subtract_inplace_front (Unsigned_integer_type &e1, Unsigned_integer_type e2) |
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. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | subtract_inplace_back (Unsigned_integer_type e1, Unsigned_integer_type &e2) |
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. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | multiply (Unsigned_integer_type e1, Unsigned_integer_type e2) |
Returns the multiplication of two elements in the field. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | multiply_inplace (Unsigned_integer_type &e1, Unsigned_integer_type e2) |
Stores in the first element the multiplication of two given elements in the field, that is (e1 * e2) % 2 , such that the result is positive. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | multiply_and_add (Unsigned_integer_type e, Unsigned_integer_type m, Unsigned_integer_type a) |
Multiplies the first element with the second one and adds the third one. Returns the result in the field. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | multiply_and_add_inplace_front (Unsigned_integer_type &e, Unsigned_integer_type m, Unsigned_integer_type a) |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % 2 , such that the result is positive. Stores the result in the first element. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | multiply_and_add_inplace_back (Unsigned_integer_type e, Unsigned_integer_type m, Unsigned_integer_type &a) |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % 2 , such that the result is positive. Stores the result in the third element. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | add_and_multiply (Unsigned_integer_type e, Unsigned_integer_type a, Unsigned_integer_type m) |
Adds the first element to the second one and multiplies the third one with it. Returns the result in the field. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | add_and_multiply_inplace_front (Unsigned_integer_type &e, Unsigned_integer_type a, Unsigned_integer_type m) |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % 2 , such that the result is positive. Stores the result in the first element. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static void | add_and_multiply_inplace_back (Unsigned_integer_type &e, Unsigned_integer_type a, Unsigned_integer_type m) |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % 2 , such that the result is positive. Stores the result in the third element. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static bool | are_equal (Unsigned_integer_type e1, Unsigned_integer_type e2) |
Returns true if the two given elements are equal in the field, false otherwise. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static Element | get_inverse (Unsigned_integer_type e) |
Returns the inverse of the given element in the field. | |
template<typename Unsigned_integer_type , class = isUnsignedInteger<Unsigned_integer_type>> | |
static std::pair< Element, Characteristic > | get_partial_inverse (Unsigned_integer_type e, Characteristic productOfCharacteristics) |
For interface purposes with multi-fields. Returns the inverse together with the second argument. | |
static constexpr Element | get_additive_identity () |
Returns the additive identity of the field. | |
static constexpr Element | get_multiplicative_identity () |
Returns the multiplicative identity of the field. | |
static constexpr Element | get_partial_multiplicative_identity (Characteristic productOfCharacteristics) |
For interface purposes with multi-fields. Returns the multiplicative identity of the field. | |
Class defining operators for the \( \mathbb{F}_2 \) field.
using Gudhi::persistence_fields::Z2_field_operators::Characteristic = unsigned int |
Type for the field characteristic.
Type for the elements in the field.
|
inlinestatic |
Returns the sum of two elements in the field.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
(e1 + e2) % 2
as a boolean.
|
inlinestatic |
Adds the first element to the second one and multiplies the third one with it. Returns the result in the field.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
a | Second element. |
m | Third element. |
((e + a) * m) % 2
as a boolean.
|
inlinestatic |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % 2
, such that the result is positive. Stores the result in the third element.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
a | Second element. |
m | Third element. |
|
inlinestatic |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % 2
, such that the result is positive. Stores the result in the first element.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
a | Second element. |
m | Third element. |
|
inlinestatic |
Stores in the first element the sum of two given elements in the field, that is (e1 + e2) % 2
, such that the result is positive.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
|
inlinestatic |
Returns true if the two given elements are equal in the field, false otherwise.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element to compare. |
e2 | Second element to compare. |
e1 % 2 == e2 % 2
.
|
inlinestaticconstexpr |
Returns the additive identity of the field.
|
inlinestaticconstexpr |
Returns the characteristic of the field, that is 2
.
|
inlinestatic |
Returns the inverse of the given element in the field.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | Element to get the inverse from. |
e % 2
.
|
inlinestaticconstexpr |
Returns the multiplicative identity of the field.
|
inlinestatic |
For interface purposes with multi-fields. Returns the inverse together with the second argument.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
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. |
|
inlinestatic |
Returns the value of an integer in the field. That is the positive value of the integer modulo the current characteristic.
Integer_type | A native integer type: int, unsigned int, long int, bool, etc. |
e | Integer to return the value from. |
e % 2
.
|
inlinestatic |
Returns the multiplication of two elements in the field.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
(e1 * e2) % 2
as a boolean.
|
inlinestatic |
Multiplies the first element with the second one and adds the third one. Returns the result in the field.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
m | Second element. |
a | Third element. |
(e * m + a) % 2
as a boolean.
|
inlinestatic |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % 2
, such that the result is positive. Stores the result in the third element.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
m | Second element. |
a | Third element. |
|
inlinestatic |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % 2
, such that the result is positive. Stores the result in the first element.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e | First element. |
m | Second element. |
a | Third element. |
|
inlinestatic |
Stores in the first element the multiplication of two given elements in the field, that is (e1 * e2) % 2
, such that the result is positive.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
|
inlinestatic |
Returns the subtraction in the field of the first element by the second element.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
(e1 - e2) % 2
as a boolean.
|
inlinestatic |
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.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |
|
inlinestatic |
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.
Unsigned_integer_type | A native unsigned integer type: unsigned int, bool, etc. |
e1 | First element. |
e2 | Second element. |