Loading...
Searching...
No Matches
Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class > Class Template Reference
Persistence Fields

Class representing an element of the \( \mathbb{F}_p \) field for any prime number \( p \). If each instantiation of the class can represent another element, they all share the same characteristics. That is if the characteristics are set for one, they will be set for all the others. The characteristics can be set before instantiating the elements with the static Shared_Zp_field_element::initialize method. More...

`#include <gudhi/Fields/Zp_field_shared.h>`

## Public Types

using | Element = Unsigned_integer_type
using | Characteristic = Element

## 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.
| Shared_Zp_field_element (const Shared_Zp_field_element &toCopy)
| Copy constructor.
| Shared_Zp_field_element (Shared_Zp_field_element &&toMove) noexcept
| Move constructor.
Element | get_value () const
| Returns the value of the element.
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.
| 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.
std::pair< Shared_Zp_field_element, Characteristic > | get_partial_inverse (Characteristic productOfCharacteristics) const
| For interface purposes with multi-fields. Returns the inverse together with the argument.

## Static Public Member Functions

static void | initialize (Characteristic characteristic)
| Initialize the field to the given characteristic. Should be called first before constructing the field elements.
static Shared_Zp_field_element | get_additive_identity ()
| Returns the additive identity of the field.
static Shared_Zp_field_element | get_multiplicative_identity ()
| Returns the multiplicative identity of the field.
static Shared_Zp_field_element | get_partial_multiplicative_identity (Characteristic productOfCharacteristics)
| For interface purposes with multi-fields. Returns the multiplicative identity of the field.
static Characteristic | get_characteristic ()
| Returns the current characteristic.

## 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+=
template<typename Integer_type, class = isInteger<Integer_type>>
Shared_Zp_field_element | operator+ (Shared_Zp_field_element f, const Integer_type &v)
| operator+
template<typename Integer_type, class = isInteger<Integer_type>>
Integer_type | operator+ (const Integer_type &v, Shared_Zp_field_element f)
| operator+
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-=
template<typename Integer_type, class = isInteger<Integer_type>>
Shared_Zp_field_element | operator- (Shared_Zp_field_element f, const Integer_type &v)
| operator-
template<typename Integer_type, class = isInteger<Integer_type>>
Integer_type | operator- (const Integer_type &v, const Shared_Zp_field_element &f)
| operator-
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*=
template<typename Integer_type, class = isInteger<Integer_type>>
Shared_Zp_field_element | operator* (Shared_Zp_field_element f, const Integer_type &v)
| operator*
template<typename Integer_type, class = isInteger<Integer_type>>
Integer_type | operator* (const Integer_type &v, Shared_Zp_field_element f)
| operator*
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==
template<typename Integer_type, class = isInteger<Integer_type>>
bool | operator== (const Shared_Zp_field_element &f, const Integer_type &v)
| operator==
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!=
template<typename Integer_type, class = isInteger<Integer_type>>
bool | operator!= (const Shared_Zp_field_element &f, const Integer_type &v)
| operator!=
void | swap (Shared_Zp_field_element &f1, Shared_Zp_field_element &f2)
| Swap operator.

## Detailed Description

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
class Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >

Class representing an element of the \( \mathbb{F}_p \) field for any prime number \( p \). If each instantiation of the class can represent another element, they all share the same characteristics. That is if the characteristics are set for one, they will be set for all the others. The characteristics can be set before instantiating the elements with the static Shared_Zp_field_element::initialize method.

Template Parameters

  Unsigned_integer_type | A native unsigned integer type: unsigned int, long unsigned int, etc. Will be used as the field element type.

Examples
  example_field_operations.cpp.

## Member Typedef Documentation

## Characteristic

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

using Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::Characteristic = Element

Type for the field characteristic.

## Element

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

using Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::Element = Unsigned_integer_type

Type for the elements in the field.

## Constructor & Destructor Documentation

## Shared_Zp_field_element() [1/3]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::Shared_Zp_field_element | ( | Integer_type | element | ) |

inline

Constructor setting the element to the given value.

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

Parameters

  element | Value of the element.

## Shared_Zp_field_element() [2/3]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::Shared_Zp_field_element | ( | const Shared_Zp_field_element< Unsigned_integer_type, class > & | toCopy | ) |

inline

Copy constructor.

Parameters

  toCopy | Element to copy.

## Shared_Zp_field_element() [3/3]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::Shared_Zp_field_element | ( | Shared_Zp_field_element< Unsigned_integer_type, class > && | toMove | ) |

inline noexcept

Move constructor.

Parameters

  toMove | Element to move.

## Member Function Documentation

## get_additive_identity()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Shared_Zp_field_element Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_additive_identity | ( |  | ) |

inline static

Returns the additive identity of the field.

Returns
  0.

## get_characteristic()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Characteristic Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_characteristic | ( |  | ) |

inline static

Returns the current characteristic.

Returns
  The value of the current characteristic.

## get_inverse()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Shared_Zp_field_element Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_inverse | ( |  | ) | const

inline

Returns the inverse of the element in the field.

Returns
  The inverse.

## get_multiplicative_identity()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Shared_Zp_field_element Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_multiplicative_identity | ( |  | ) |

inline static

Returns the multiplicative identity of the field.

Returns
  1.

## get_partial_inverse()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

std::pair< Shared_Zp_field_element, Characteristic > Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_partial_inverse | ( | Characteristic | productOfCharacteristics | ) | const

inline

For interface purposes with multi-fields. Returns the inverse together with the argument.

Parameters

  productOfCharacteristics | Some value.

Returns
  Pair whose first element is the inverse and the second element is `productOfCharacteristics`.

## get_partial_multiplicative_identity()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Shared_Zp_field_element Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_partial_multiplicative_identity | ( | Characteristic | productOfCharacteristics | ) |

inline static

For interface purposes with multi-fields. Returns the multiplicative identity of the field.

Parameters

  productOfCharacteristics | Some value.

Returns
  1.

## get_value()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

Element Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::get_value | ( |  | ) | const

inline

Returns the value of the element.

Returns
  Value of the element.

## initialize()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>

void Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::initialize | ( | Characteristic | characteristic | ) |

inline static

Initialize the field to the given characteristic. Should be called first before constructing the field elements.

Parameters

  characteristic | Characteristic of the field. A positive prime number.

## operator=()

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Shared_Zp_field_element & Gudhi::persistence_fields::Shared_Zp_field_element< Unsigned_integer_type, class >::operator= | ( | const Integer_type & | value | ) |

inline

Assign operator.

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## Friends And Related Symbol Documentation

## operator!= [1/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

bool operator!= | ( | const Integer_type & | v,
|  | const Shared_Zp_field_element< Unsigned_integer_type, class > & | f )

friend

operator!=

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator!= [2/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

bool operator!= | ( | const Shared_Zp_field_element< Unsigned_integer_type, class > & | f,
|  | const Integer_type & | v )

friend

operator!=

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator* [1/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator* | ( | const Integer_type & | v,
|  | Shared_Zp_field_element< Unsigned_integer_type, class > | f )

friend

operator*

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic. if signed.

## operator* [2/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Shared_Zp_field_element operator* | ( | Shared_Zp_field_element< Unsigned_integer_type, class > | f,
|  | const Integer_type & | v )

friend

operator*

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator*=

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

void operator*= | ( | Shared_Zp_field_element< Unsigned_integer_type, class > & | f,
|  | const Integer_type & | v )

friend

operator*=

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator+ [1/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator+ | ( | const Integer_type & | v,
|  | Shared_Zp_field_element< Unsigned_integer_type, class > | f )

friend

operator+

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator+ [2/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Shared_Zp_field_element operator+ | ( | Shared_Zp_field_element< Unsigned_integer_type, class > | f,
|  | const Integer_type & | v )

friend

operator+

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator+=

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

void operator+= | ( | Shared_Zp_field_element< Unsigned_integer_type, class > & | f,
|  | const Integer_type & | v )

friend

operator+=

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator- [1/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator- | ( | const Integer_type & | v,
|  | const Shared_Zp_field_element< Unsigned_integer_type, class > & | f )

friend

operator-

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator- [2/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

Shared_Zp_field_element operator- | ( | Shared_Zp_field_element< Unsigned_integer_type, class > | f,
|  | const Integer_type & | v )

friend

operator-

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator-=

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

void operator-= | ( | Shared_Zp_field_element< Unsigned_integer_type, class > & | f,
|  | const Integer_type & | v )

friend

operator-=

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator== [1/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

bool operator== | ( | const Integer_type & | v,
|  | const Shared_Zp_field_element< Unsigned_integer_type, class > & | f )

friend

operator==

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

## operator== [2/2]

template<typename Unsigned_integer_type = unsigned int, class = std::enable_if_t<std::is_unsigned_v<Unsigned_integer_type> >>
template<typename Integer_type, class = isInteger<Integer_type>>

bool operator== | ( | const Shared_Zp_field_element< Unsigned_integer_type, class > & | f,
|  | const Integer_type & | v )

friend

operator==

Template Parameters

  Integer_type | A native integer type. Should be able to contain the characteristic if signed.

The documentation for this class was generated from the following file:

- include/gudhi/Fields/Zp_field_shared.h