Loading...
Searching...
No Matches
Gudhi::persistence_matrix::FieldOperators Class Reference
Persistence Matrix

Concept of the field operator classes needed for the class Matrix. More...

`#include <concept/Persistence_matrix/FieldOperators.h>`

## Public Types

using | Element = unspecified
using | Characteristic = unspecified

## Public Member Functions

| FieldOperators (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.
void | set_characteristic (const Characteristic &characteristic)
| Sets the characteristic of the field. Can eventually be omitted if the characteristic of the class is fixed.
const Characteristic & | get_characteristic () const
| Returns the current characteristic.
template<typename Integer_type>
Element | 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.
void | add_inplace (Element &e1, const 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.
void | multiply_inplace (Element &e1, const 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.
void | multiply_and_add_inplace_front (Element &e, const Element &m, const 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.
void | multiply_and_add_inplace_back (const Element &e, const 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.
Element | get_inverse (const Element &e) const
| Returns the inverse of the given element in the field.
FieldOperators & | operator= (FieldOperators other)
| Assign operator.

## Static Public Member Functions

static const Element & | get_additive_identity ()
| Returns the additive identity of the field.
static const Element & | get_multiplicative_identity ()
| Returns the multiplicative identity of the field.

## Friends

void | swap (FieldOperators &f1, FieldOperators &f2)
| Swap operator.

## Detailed Description

Concept of the field operator classes needed for the class Matrix.

Implementations of this concept are Gudhi::persistence_fields::Zp_field_operators, Gudhi::persistence_fields::Z2_field_operators, Gudhi::persistence_fields::Multi_field_operators and Gudhi::persistence_fields::Multi_field_operators_with_small_characteristics.

## Member Typedef Documentation

## Characteristic

using Gudhi::persistence_matrix::FieldOperators::Characteristic = unspecified

Type for the field characteristic.

## Element

using Gudhi::persistence_matrix::FieldOperators::Element = unspecified

Type for the elements in the field.

## Constructor & Destructor Documentation

## FieldOperators()

Gudhi::persistence_matrix::FieldOperators::FieldOperators | ( | 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.

Parameters

  characteristic | Prime number corresponding to the desired characteristic of the field.

## Member Function Documentation

## add_inplace()

void Gudhi::persistence_matrix::FieldOperators::add_inplace | ( | Element & | e1,
|  | const 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.

Parameters

  e1 | First element.
  e2 | Second element.

## get_additive_identity()

const Element & 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 & Gudhi::persistence_matrix::FieldOperators::get_characteristic | ( |  | ) | const

Returns the current characteristic.

Returns
  The value of the current characteristic.

## get_inverse()

Element Gudhi::persistence_matrix::FieldOperators::get_inverse | ( | const Element & | e | ) | const

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()

const Element & 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 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()

void Gudhi::persistence_matrix::FieldOperators::multiply_and_add_inplace_back | ( | const Element & | e,
|  | const 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.

Parameters

  e | First element.
  m | Second element.
  a | Third element.

## multiply_and_add_inplace_front()

void Gudhi::persistence_matrix::FieldOperators::multiply_and_add_inplace_front | ( | Element & | e,
|  | const Element & | m,
|  | const 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.

Parameters

  e | First element.
  m | Second element.
  a | Third element.

## multiply_inplace()

void Gudhi::persistence_matrix::FieldOperators::multiply_inplace | ( | Element & | e1,
|  | const 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.

Parameters

  e1 | First element.
  e2 | Second element.

## set_characteristic()

void Gudhi::persistence_matrix::FieldOperators::set_characteristic | ( | const Characteristic & | 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:

- concept/Persistence_matrix/FieldOperators.h