Class defining operators for a multi-field with "consecutive" charateristic range, such that productOfAllCharacteristics ^ 2
fits into an unsigned int.
More...
#include <gudhi/Fields/Multi_field_small_operators.h>
Public Types | |
using | element_type = unsigned int |
using | characteristic_type = element_type |
Public Member Functions | |
Multi_field_operators_with_small_characteristics () | |
Default constructor, sets the product of all characteristics to 0. | |
Multi_field_operators_with_small_characteristics (int minCharacteristic, int maxCharacteristic) | |
Constructor setting the characteristics to all prime numbers between the two given integers. The product of all primes to the square has to fit into an unsigned int. | |
Multi_field_operators_with_small_characteristics (const Multi_field_operators_with_small_characteristics &toCopy) | |
Copy constructor. | |
Multi_field_operators_with_small_characteristics (Multi_field_operators_with_small_characteristics &&toMove) noexcept | |
Move constructor. | |
void | set_characteristic (int minimum, int maximum) |
Set the characteristics of the field, which are stored in a single value as a product of all of them. The characteristics will be all prime numbers in the given interval. The product of all primes to the square has to fit into an unsigned int. | |
const characteristic_type & | get_characteristic () const |
Returns the current characteristics as the product of all of them. | |
element_type | get_value (element_type e) const |
Returns the value of an element in the field. That is the positive value of the integer modulo the current characteristic. | |
element_type | add (element_type e1, element_type e2) const |
Returns the sum of two elements in the field. | |
void | add_inplace (element_type &e1, element_type e2) const |
Stores in the first element the sum of two given elements in the field, that is (e1 + e2) % productOfAllCharacteristics , such that the result is positive. | |
element_type | substract (element_type e1, element_type e2) const |
Returns the substraction in the field of the first element by the second element. | |
void | substract_inplace_front (element_type &e1, element_type e2) const |
Stores in the first element the substraction in the field of the first element by the second element, that is (e1 - e2) % productOfAllCharacteristics , such that the result is positive. | |
void | substract_inplace_back (element_type e1, element_type &e2) const |
Stores in the second element the substraction in the field of the first element by the second element, that is (e1 - e2) % productOfAllCharacteristics , such that the result is positive. | |
element_type | multiply (element_type e1, element_type e2) const |
Returns the multiplication of two elements in the field. | |
void | multiply_inplace (element_type &e1, element_type e2) const |
Stores in the first element the multiplication of two given elements in the field, that is (e1 * e2) % productOfAllCharacteristics , such that the result is positive. | |
element_type | multiply_and_add (element_type e, element_type m, element_type a) const |
Multiplies the first element with the second one and adds the third one. Returns the result in the field. | |
void | multiply_and_add_inplace_front (element_type &e, element_type m, element_type a) const |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % productOfAllCharacteristics , such that the result is positive. Stores the result in the first element. | |
void | multiply_and_add_inplace_back (element_type e, element_type m, element_type &a) const |
Multiplies the first element with the second one and adds the third one, that is (e * m + a) % productOfAllCharacteristics , such that the result is positive. Stores the result in the third element. | |
element_type | add_and_multiply (element_type e, element_type a, element_type m) const |
Adds the first element to the second one and multiplies the third one with it. Returns the result in the field. | |
void | add_and_multiply_inplace_front (element_type &e, element_type a, element_type m) const |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % productOfAllCharacteristics , such that the result is positive. Stores the result in the first element. | |
void | add_and_multiply_inplace_back (element_type e, element_type a, element_type &m) const |
Adds the first element to the second one and multiplies the third one with it, that is ((e + a) * m) % productOfAllCharacteristics , such that the result is positive. Stores the result in the third element. | |
bool | are_equal (element_type e1, element_type e2) const |
Returns true if the two given elements are equal in the field, false otherwise. | |
element_type | get_inverse (const element_type &e) const |
Returns the inverse of the given element in the sense of [boissonnat:hal-00922572] with respect to the product of all characteristics. | |
std::pair< element_type, characteristic_type > | get_partial_inverse (const element_type &e, const characteristic_type &productOfCharacteristics) const |
Returns the inverse of the given element in the multi-field corresponding to the given sub-product of the product of all characteristics in the multi-field. See [boissonnat:hal-00922572] for more details. | |
element_type | get_partial_multiplicative_identity (const characteristic_type &productOfCharacteristics) const |
Returns the partial multiplicative identity of the multi-field from the given product. See [boissonnat:hal-00922572] for more details. | |
Multi_field_operators_with_small_characteristics & | operator= (Multi_field_operators_with_small_characteristics other) |
Assign operator. | |
Static Public Member Functions | |
static constexpr element_type | get_additive_identity () |
Returns the additive identity of a field. | |
static constexpr element_type | get_multiplicative_identity () |
Returns the multiplicative identity of a field. | |
Friends | |
void | swap (Multi_field_operators_with_small_characteristics &f1, Multi_field_operators_with_small_characteristics &f2) |
Swap operator. | |
Class defining operators for a multi-field with "consecutive" charateristic range, such that productOfAllCharacteristics ^ 2
fits into an unsigned int.
using Gudhi::persistence_fields::Multi_field_operators_with_small_characteristics::characteristic_type = element_type |
Type for the field characteristic.
using Gudhi::persistence_fields::Multi_field_operators_with_small_characteristics::element_type = unsigned int |
Type for the elements in the field.
|
inline |
Constructor setting the characteristics to all prime numbers between the two given integers. The product of all primes to the square has to fit into an unsigned int.
minCharacteristic | Smallest value of a prime. |
maxCharacteristic | Heighest value of a prime. |
|
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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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 % productOfAllCharacteristics == e2 % productOfAllCharacteristics
.
|
inlinestaticconstexpr |
Returns the additive identity of a field.
|
inline |
Returns the current characteristics as the product of all of them.
|
inline |
Returns the inverse of the given element in the sense of [boissonnat:hal-00922572] with respect to the product of all characteristics.
e | Element to get the inverse from. |
|
inlinestaticconstexpr |
Returns the multiplicative identity of a field.
|
inline |
Returns the inverse of the given element in the multi-field corresponding to the given sub-product of the product of all characteristics in the multi-field. See [boissonnat:hal-00922572] for more details.
e | Element to get the inverse from. |
productOfCharacteristics | Product of the different characteristics to take into account in the multi-field. |
e
and the characteristic the inverse is coming from.
|
inline |
Returns the partial multiplicative identity of the multi-field from the given product. See [boissonnat:hal-00922572] for more details.
productOfCharacteristics | Product of the different characteristics to take into account in the multi-field. |
|
inline |
Returns the value of an element in the field. That is the positive value of the integer modulo the current characteristic.
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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, 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) % productOfAllCharacteristics
, such that the result is positive.
e1 | First element. |
e2 | Second element. |
|
inline |
Set the characteristics of the field, which are stored in a single value as a product of all of them. The characteristics will be all prime numbers in the given interval. The product of all primes to the square has to fit into an unsigned int.
minimum | Smallest value of a prime. |
maximum | Heighest value of a prime. |
|
inline |
Returns the substraction in the field of the first element by the second element.
e1 | First element. |
e2 | Second element. |
(e1 - e2) % productOfAllCharacteristics
, such that the result is positive.
|
inline |
Stores in the second element the substraction in the field of the first element by the second element, that is (e1 - e2) % productOfAllCharacteristics
, such that the result is positive.
e1 | First element. |
e2 | Second element. |
|
inline |
Stores in the first element the substraction in the field of the first element by the second element, that is (e1 - e2) % productOfAllCharacteristics
, such that the result is positive.
e1 | First element. |
e2 | Second element. |