Loading...
Searching...
No Matches
Gudhi::persistence_fields::Shared_multi_field_element Class Reference

Class representing an element of a multi-field. 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::initialize method. More...

#include <gudhi/Fields/Multi_field_shared.h>

Public Types

using Element = mpz_class
 
using Characteristic = Element
 

Public Member Functions

 Shared_multi_field_element ()
 Default constructor. Sets the element to 0.
 
 Shared_multi_field_element (Element element)
 Constructor setting the element to the given value.
 
 operator unsigned int () const
 Casts the element into an unsigned int.
 
 operator mpz_class () const
 Casts the element into a mpz_class.
 
Shared_multi_field_element get_inverse () const
 Returns the inverse of the element in the multi-field, see [6].
 
std::pair< Shared_multi_field_element, Characteristicget_partial_inverse (const Characteristic &productOfCharacteristics) const
 Returns the inverse of the element with respect to a sub-product of the characteristics in the multi-field, see [6].
 
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.
 
static Shared_multi_field_element get_additive_identity ()
 Returns the additive identity of a field.
 
static Shared_multi_field_element get_multiplicative_identity ()
 Returns the multiplicative identity of a field.
 
static Shared_multi_field_element get_partial_multiplicative_identity (const Characteristic &productOfCharacteristics)
 Returns the partial multiplicative identity of the multi-field from the given product. See [6] for more details.
 
static Characteristic get_characteristic ()
 Returns the product of all characteristics.
 

Friends

void operator+= (Shared_multi_field_element &f1, Shared_multi_field_element const &f2)
 operator+=
 
Shared_multi_field_element operator+ (Shared_multi_field_element f1, Shared_multi_field_element const &f2)
 operator+
 
void operator+= (Shared_multi_field_element &f, const Element &v)
 operator+=
 
Shared_multi_field_element operator+ (Shared_multi_field_element f, const Element &v)
 operator+
 
Element operator+ (Element v, Shared_multi_field_element const &f)
 operator+
 
void operator-= (Shared_multi_field_element &f1, Shared_multi_field_element const &f2)
 operator-=
 
Shared_multi_field_element operator- (Shared_multi_field_element f1, Shared_multi_field_element const &f2)
 operator-
 
void operator-= (Shared_multi_field_element &f, const Element &v)
 operator-=
 
Shared_multi_field_element operator- (Shared_multi_field_element f, const Element &v)
 operator-
 
Element operator- (Element v, Shared_multi_field_element const &f)
 operator-
 
void operator*= (Shared_multi_field_element &f1, Shared_multi_field_element const &f2)
 operator*=
 
Shared_multi_field_element operator* (Shared_multi_field_element f1, Shared_multi_field_element const &f2)
 operator*
 
void operator*= (Shared_multi_field_element &f, const Element &v)
 operator*=
 
Shared_multi_field_element operator* (Shared_multi_field_element f, const Element &v)
 operator*
 
Element operator* (Element v, Shared_multi_field_element const &f)
 operator*
 
bool operator== (const Shared_multi_field_element &f1, const Shared_multi_field_element &f2)
 operator==
 
bool operator== (const Element &v, const Shared_multi_field_element &f)
 operator==
 
bool operator== (const Shared_multi_field_element &f, const Element &v)
 operator==
 
bool operator!= (const Shared_multi_field_element &f1, const Shared_multi_field_element &f2)
 operator!=
 
bool operator!= (const Element &v, const Shared_multi_field_element &f)
 operator!=
 
bool operator!= (const Shared_multi_field_element &f, const Element &v)
 operator!=
 
void swap (Shared_multi_field_element &f1, Shared_multi_field_element &f2) noexcept
 Assign operator.
 

Detailed Description

Class representing an element of a multi-field. 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::initialize method.

Member Typedef Documentation

◆ Characteristic

◆ Element

Type for the elements in the field.

Constructor & Destructor Documentation

◆ Shared_multi_field_element()

Gudhi::persistence_fields::Shared_multi_field_element::Shared_multi_field_element ( Element element)
inline

Constructor setting the element to the given value.

Parameters
elementValue of the element.

Member Function Documentation

◆ get_additive_identity()

static Shared_multi_field_element Gudhi::persistence_fields::Shared_multi_field_element::get_additive_identity ( )
inlinestatic

Returns the additive identity of a field.

Returns
The additive identity of a field.

◆ get_characteristic()

static Characteristic Gudhi::persistence_fields::Shared_multi_field_element::get_characteristic ( )
inlinestatic

Returns the product of all characteristics.

Returns
The product of all characteristics.

◆ get_inverse()

Shared_multi_field_element Gudhi::persistence_fields::Shared_multi_field_element::get_inverse ( ) const
inlinenodiscard

Returns the inverse of the element in the multi-field, see [6].

Returns
The inverse.

◆ get_multiplicative_identity()

static Shared_multi_field_element Gudhi::persistence_fields::Shared_multi_field_element::get_multiplicative_identity ( )
inlinestatic

Returns the multiplicative identity of a field.

Returns
The multiplicative identity of a field.

◆ get_partial_inverse()

std::pair< Shared_multi_field_element, Characteristic > Gudhi::persistence_fields::Shared_multi_field_element::get_partial_inverse ( const Characteristic & productOfCharacteristics) const
inlinenodiscard

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

Parameters
productOfCharacteristicsSub-product of the characteristics.
Returns
Pair of the inverse and the characteristic the inverse corresponds to.

◆ get_partial_multiplicative_identity()

static Shared_multi_field_element Gudhi::persistence_fields::Shared_multi_field_element::get_partial_multiplicative_identity ( const Characteristic & productOfCharacteristics)
inlinestatic

Returns the partial multiplicative identity of the multi-field from the given product. See [6] for more details.

Parameters
productOfCharacteristicsProduct of the different characteristics to take into account in the multi-field.
Returns
The partial multiplicative identity of the multi-field.

◆ get_value()

Element Gudhi::persistence_fields::Shared_multi_field_element::get_value ( ) const
inlinenodiscard

Returns the value of the element.

Returns
Value of the element.

◆ initialize()

static void Gudhi::persistence_fields::Shared_multi_field_element::initialize ( unsigned int minimum,
unsigned int maximum )
inlinestatic

Initialize the multi-field to the characteristics (primes) contained in the given interval. Should be called first before constructing the field elements.

Parameters
minimumLowest value in the interval.
maximumHighest value in the interval.

Friends And Related Symbol Documentation

◆ swap

void swap ( Shared_multi_field_element & f1,
Shared_multi_field_element & f2 )
friend

Assign operator.

Swap operator.


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