Loading...
Searching...
No Matches
Gudhi::persistence_fields::Z2_field_element Class Reference
Persistence Fields

Class representing an element of the \( \mathbb{F}_2 \) field. More...

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

## Public Types

using | Element = bool

## Public Member Functions

| Z2_field_element ()
| Default constructor.
template<typename Integer_type, class = isInteger<Integer_type>>
| Z2_field_element (Integer_type element)
| Constructor setting the element to the given value.
| Z2_field_element (const Z2_field_element &toCopy)
| Copy constructor.
| Z2_field_element (Z2_field_element &&toMove) noexcept
| Move constructor.
Z2_field_element & | operator= (Z2_field_element other)
| Assign operator.
Z2_field_element & | operator= (const unsigned int value)
| Assign operator.
| operator unsigned int () const
| Casts the element into an unsigned int.
Z2_field_element | get_inverse () const
| Returns the inverse of the element.
std::pair< Z2_field_element, unsigned int > | get_partial_inverse (unsigned int productOfCharacteristics) const
| For interface purposes with multi-fields. Returns the inverse together with the second argument.
Element | get_value () const
| Returns the value of the element.

## Static Public Member Functions

static Z2_field_element | get_additive_identity ()
| Returns the additive identity of the field.
static Z2_field_element | get_multiplicative_identity ()
| Returns the multiplicative identity of the field.
static Z2_field_element | get_partial_multiplicative_identity (unsigned int productOfCharacteristics)
| For interface purposes with multi-fields. Returns the multiplicative identity of the field.
static constexpr unsigned int | get_characteristic ()
| Returns the characteristic of the field, that is 2.

## Friends

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

## Detailed Description

Class representing an element of the \( \mathbb{F}_2 \) field.

Examples
  example_field_operations.cpp.

## Member Typedef Documentation

## Element

using Gudhi::persistence_fields::Z2_field_element::Element = bool

Type for the elements in the field.

## Constructor & Destructor Documentation

## Z2_field_element() [1/3]

template<typename Integer_type, class>

Gudhi::persistence_fields::Z2_field_element::Z2_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.

Parameters

  element | Value of the element.

## Z2_field_element() [2/3]

Gudhi::persistence_fields::Z2_field_element::Z2_field_element | ( | const Z2_field_element & | toCopy | ) |

inline

Copy constructor.

Parameters

  toCopy | Element to copy.

## Z2_field_element() [3/3]

Gudhi::persistence_fields::Z2_field_element::Z2_field_element | ( | Z2_field_element && | toMove | ) |

inline noexcept

Move constructor.

Parameters

  toMove | Element to move.

## Member Function Documentation

## get_additive_identity()

Z2_field_element Gudhi::persistence_fields::Z2_field_element::get_additive_identity | ( |  | ) |

inline static

Returns the additive identity of the field.

Returns
  false.

## get_characteristic()

unsigned int Gudhi::persistence_fields::Z2_field_element::get_characteristic | ( |  | ) |

inline static constexpr

Returns the characteristic of the field, that is 2.

Returns
  2.

## get_inverse()

Z2_field_element Gudhi::persistence_fields::Z2_field_element::get_inverse | ( |  | ) | const

inline

Returns the inverse of the element.

Returns
  The inverse.

## get_multiplicative_identity()

Z2_field_element Gudhi::persistence_fields::Z2_field_element::get_multiplicative_identity | ( |  | ) |

inline static

Returns the multiplicative identity of the field.

Returns
  true.

## get_partial_inverse()

std::pair< Z2_field_element, unsigned int > Gudhi::persistence_fields::Z2_field_element::get_partial_inverse | ( | unsigned int | productOfCharacteristics | ) | const

inline

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

Parameters

  productOfCharacteristics | Some value.

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

## get_partial_multiplicative_identity()

Z2_field_element Gudhi::persistence_fields::Z2_field_element::get_partial_multiplicative_identity | ( | unsigned int | productOfCharacteristics | ) |

inline static

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

Parameters

  productOfCharacteristics | Some value.

Returns
  true.

## get_value()

Z2_field_element::Element Gudhi::persistence_fields::Z2_field_element::get_value | ( |  | ) | const

inline

Returns the value of the element.

Returns
  Value of the element.

## Friends And Related Symbol Documentation

## operator!= [1/2]

template<typename Integer_type, class = isInteger<Integer_type>>

bool operator!= | ( | const Integer_type | v,
|  | const Z2_field_element & | f )

friend

operator!=

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator!= [2/2]

template<typename Integer_type, class = isInteger<Integer_type>>

bool operator!= | ( | const Z2_field_element & | f,
|  | const Integer_type | v )

friend

operator!=

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator* [1/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator* | ( | const Integer_type & | v,
|  | Z2_field_element const & | f )

friend

operator*

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator* [2/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Z2_field_element operator* | ( | Z2_field_element | f,
|  | const Integer_type & | v )

friend

operator*

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator*=

template<typename Integer_type, class = isInteger<Integer_type>>

void operator*= | ( | Z2_field_element & | f,
|  | const Integer_type & | v )

friend

operator*=

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator+ [1/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator+ | ( | const Integer_type & | v,
|  | const Z2_field_element & | f )

friend

operator+

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator+ [2/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Z2_field_element operator+ | ( | Z2_field_element | f,
|  | const Integer_type & | v )

friend

operator+

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator+=

template<typename Integer_type, class = isInteger<Integer_type>>

void operator+= | ( | Z2_field_element & | f,
|  | const Integer_type & | v )

friend

operator+=

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator- [1/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Integer_type operator- | ( | const Integer_type | v,
|  | Z2_field_element const & | f )

friend

operator-

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator- [2/2]

template<typename Integer_type, class = isInteger<Integer_type>>

Z2_field_element operator- | ( | Z2_field_element | f,
|  | const Integer_type & | v )

friend

operator-

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator-=

template<typename Integer_type, class = isInteger<Integer_type>>

void operator-= | ( | Z2_field_element & | f,
|  | const Integer_type & | v )

friend

operator-=

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator== [1/2]

template<typename Integer_type, class = isInteger<Integer_type>>

bool operator== | ( | const Integer_type & | v,
|  | const Z2_field_element & | f )

friend

operator==

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

## operator== [2/2]

template<typename Integer_type, class = isInteger<Integer_type>>

bool operator== | ( | const Z2_field_element & | f,
|  | const Integer_type & | v )

friend

operator==

Template Parameters

  Integer_type | A native integer type: int, unsigned int, long int, bool, etc.

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

- include/gudhi/Fields/Z2_field.h