Concept of the field operator classes needed for the class Matrix.
More...
|
| FieldOperators (characteristic_type 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...
|
|
void | set_characteristic (const characteristic_type &characteristic) |
| Sets the characteristic of the field. Can eventually be omitted if the characteristic of the class is fixed. More...
|
|
const characteristic_type & | get_characteristic () const |
| Returns the current characteristic. More...
|
|
template<typename Integer_type > |
element_type | get_value (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...
|
|
void | add_inplace (element_type &e1, const element_type &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...
|
|
void | multiply_inplace (element_type &e1, const element_type &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...
|
|
void | multiply_and_add_inplace_front (element_type &e, const element_type &m, const element_type &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 (const element_type &e, const 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) % characteristic , such that the result is positive. Stores the result in the third element. More...
|
|
element_type | get_inverse (const element_type &e) const |
| Returns the inverse of the given element in the field. More...
|
|
FieldOperators & | operator= (FieldOperators other) |
| Assign operator.
|
|
◆ characteristic_type
Type for the field characteristic.
◆ element_type
Type for the elements in the field.
◆ FieldOperators()
Gudhi::persistence_matrix::FieldOperators::FieldOperators |
( |
characteristic_type |
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.
- Parameters
-
characteristic | Prime number corresponding to the desired characteristic of the field. |
◆ add_inplace()
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.
- Parameters
-
e1 | First element. |
e2 | Second element. |
◆ get_additive_identity()
static const element_type& Gudhi::persistence_matrix::FieldOperators::get_additive_identity |
( |
| ) |
|
|
static |
Returns the additive identity of the field.
- Returns
- The additive identity of the field.
◆ get_characteristic()
const characteristic_type& Gudhi::persistence_matrix::FieldOperators::get_characteristic |
( |
| ) |
const |
Returns the current characteristic.
- Returns
- The value of the current characteristic.
◆ get_inverse()
Returns the inverse of the given element in the field.
- Parameters
-
e | Element to get the inverse from. |
- Returns
- Inverse in the current field of
e % characteristic
.
◆ get_multiplicative_identity()
static const element_type& Gudhi::persistence_matrix::FieldOperators::get_multiplicative_identity |
( |
| ) |
|
|
static |
Returns the multiplicative identity of the field.
- Returns
- The multiplicative identity of the field.
◆ get_value()
template<typename Integer_type >
element_type Gudhi::persistence_matrix::FieldOperators::get_value |
( |
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.
- Template Parameters
-
Integer_type | A native integer type: int, unsigned int, long int, bool, etc. |
- Parameters
-
e | Integer to return the value from. |
- Returns
e
modulo the current characteristic, such that the result is positive.
◆ multiply_and_add_inplace_back()
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.
- Parameters
-
e | First element. |
m | Second element. |
a | Third element. |
◆ multiply_and_add_inplace_front()
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.
- Parameters
-
e | First element. |
m | Second element. |
a | Third element. |
◆ multiply_inplace()
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.
- Parameters
-
e1 | First element. |
e2 | Second element. |
◆ set_characteristic()
void Gudhi::persistence_matrix::FieldOperators::set_characteristic |
( |
const characteristic_type & |
characteristic | ) |
|
Sets the characteristic of the field. Can eventually be omitted if the characteristic of the class is fixed.
- Parameters
-
characteristic | Prime number corresponding to the desired characteristic of the field. |
The documentation for this class was generated from the following file: