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

Class representing an element of a multi-field, such that productOfAllCharacteristics ^ 2 fits into the given `Unsigned_integer_type` template argument. 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_multi_field_element_with_small_characteristics::initialize method. More...

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

## Public Types

using | Element = Unsigned_integer_type
using | Characteristic = Element

## Public Member Functions

| Shared_multi_field_element_with_small_characteristics ()
| Default constructor. Sets the element to 0.
template<typename Integer_type, class = isInteger<Integer_type>>
| Shared_multi_field_element_with_small_characteristics (Integer_type element)
| Constructor setting the element to the given value.
| Shared_multi_field_element_with_small_characteristics (const Shared_multi_field_element_with_small_characteristics &toCopy)
| Copy constructor.
| Shared_multi_field_element_with_small_characteristics (Shared_multi_field_element_with_small_characteristics &&toMove) noexcept
| Move constructor.
Shared_multi_field_element_with_small_characteristics & | operator= (Shared_multi_field_element_with_small_characteristics other)
| Assign operator.
template<typename Integer_type, class = isInteger<Integer_type>>
Shared_multi_field_element_with_small_characteristics & | operator= (const Integer_type &value)
| Assign operator.
| operator unsigned int () const
| Casts the element into an unsigned int.
Shared_multi_field_element_with_small_characteristics | get_inverse () const
| Returns the inverse of the element in the multi-field, see [boissonnat:hal-00922572].
std::pair< Shared_multi_field_element_with_small_characteristics, Characteristic > | get_partial_inverse (Characteristic productOfCharacteristics) const
| Returns the inverse of the element with respect to a sub-product of the characteristics in the multi-field, see [boissonnat:hal-00922572].
Element | get_value () const
| Returns the value of the element.

## Static Public Member Functions

static void | initialize (unsigned int minimum, unsigned int maximum)
| Initialize the multi-field to the characteristics (primes) contained in the given interval. Should be called first before constructing the field elements. The characteristics must be small enough such that productOfAllCharacteristics ^ 2 fits into an unsigned int.
static Shared_multi_field_element_with_small_characteristics | get_additive_identity ()
| Returns the additive identity of a field.
static Shared_multi_field_element_with_small_characteristics | get_multiplicative_identity ()
| Returns the multiplicative identity of a field.
static Shared_multi_field_element_with_small_characteristics | get_partial_multiplicative_identity (const Characteristic &productOfCharacteristics)
| Returns the partial multiplicative identity of the multi-field from the given product. See [boissonnat:hal-00922572] for more details.
static Characteristic | get_characteristic ()
| Returns the product of all characteristics.

## Friends

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

Class representing an element of a multi-field, such that productOfAllCharacteristics ^ 2 fits into the given `Unsigned_integer_type` template argument. 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_multi_field_element_with_small_characteristics::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.

## 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::Element = Unsigned_integer_type

Type for the elements in the field.

## Constructor & Destructor Documentation

## Shared_multi_field_element_with_small_characteristics() [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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::Shared_multi_field_element_with_small_characteristics | ( | 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 negative.

Parameters

  element | Value of the element.

## Shared_multi_field_element_with_small_characteristics() [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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::Shared_multi_field_element_with_small_characteristics | ( | const Shared_multi_field_element_with_small_characteristics< Unsigned_integer_type, class > & | toCopy | ) |

inline

Copy constructor.

Parameters

  toCopy | Element to copy.

## Shared_multi_field_element_with_small_characteristics() [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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::Shared_multi_field_element_with_small_characteristics | ( | Shared_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics Gudhi::persistence_fields::Shared_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::get_additive_identity | ( |  | ) |

inline static

Returns the additive identity of a field.

Returns
  The additive identity of a field.

## 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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::get_characteristic | ( |  | ) |

inline static

Returns the product of all characteristics.

Returns
  The product of all characteristics.

## get_inverse()

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

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

inline

Returns the inverse of the element in the multi-field, see [boissonnat:hal-00922572].

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_multi_field_element_with_small_characteristics Gudhi::persistence_fields::Shared_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::get_multiplicative_identity | ( |  | ) |

inline static

Returns the multiplicative identity of a field.

Returns
  The multiplicative identity of a field.

## 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_multi_field_element_with_small_characteristics, Characteristic > Gudhi::persistence_fields::Shared_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::get_partial_inverse | ( | Characteristic | productOfCharacteristics | ) | const

inline

Returns the inverse of the element with respect to a sub-product of the characteristics in the multi-field, see [boissonnat:hal-00922572].

Parameters

  productOfCharacteristics | Sub-product of the characteristics.

Returns
  Pair of the inverse and the characteristic the inverse corresponds to.

## get_partial_multiplicative_identity()

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

Shared_multi_field_element_with_small_characteristics Gudhi::persistence_fields::Shared_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::get_partial_multiplicative_identity | ( | const Characteristic & | productOfCharacteristics | ) |

inline static

Returns the partial multiplicative identity of the multi-field from the given product. See [boissonnat:hal-00922572] for more details.

Parameters

  productOfCharacteristics | Product of the different characteristics to take into account in the multi-field.

Returns
  The partial multiplicative identity of the multi-field.

## 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< Unsigned_integer_type, class >::initialize | ( | unsigned int | minimum,
|  | unsigned int | maximum )

inline static

Initialize the multi-field to the characteristics (primes) contained in the given interval. Should be called first before constructing the field elements. The characteristics must be small enough such that productOfAllCharacteristics ^ 2 fits into an unsigned int.

Parameters

  minimum | Lowest value in the interval.
  maximum | Highest value in the interval.

## 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_multi_field_element_with_small_characteristics & Gudhi::persistence_fields::Shared_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics operator* | ( | Shared_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics operator+ | ( | Shared_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics operator- | ( | Shared_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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_multi_field_element_with_small_characteristics< 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/Multi_field_small_shared.h