The ChainCon Software (Release 0.03)
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
tZ2 Class Reference

An element of the ring Z_2. More...

#include <ringz2.h>

Public Member Functions

 tZ2 ()
 Default constructor of a ring element. More...
 
 tZ2 (int n)
 Constructor from an integer number (to be used mainly for 0 or 1). More...
 
 operator int () const
 Conversion to an integer. More...
 
int delta () const
 The delta function. More...
 
tZ2negate ()
 Negates the ring element. More...
 
tZ2invert ()
 Inverts the ring element. More...
 
tZ2operator+= (const tZ2 &another)
 Adds another ring element. More...
 
tZ2operator*= (const tZ2 &another)
 Multiplies by another ring element. More...
 
void swap (tZ2 &another)
 Swaps the internal data with another ring element. More...
 

Static Public Member Functions

static std::string ringsymbol ()
 Returns the symbol of the ring. More...
 

Private Attributes

bool _n
 The number corresponding to the ring element. More...
 

Friends

bool divide (const tZ2 &a, const tZ2 &b, tZ2 &quotient, tZ2 &remainder)
 Performs the division with remainder in the ring. More...
 

Detailed Description

An element of the ring Z_2.

Definition at line 47 of file ringz2.h.

Constructor & Destructor Documentation

◆ tZ2() [1/2]

tZ2::tZ2 ( )
inline

Default constructor of a ring element.

Note: The default copy constructor, destructor, and assignment operators are fine.

Definition at line 98 of file ringz2.h.

Referenced by operator>>().

◆ tZ2() [2/2]

tZ2::tZ2 ( int  n)
inlineexplicit

Constructor from an integer number (to be used mainly for 0 or 1).

Definition at line 103 of file ringz2.h.

References _n.

Member Function Documentation

◆ delta()

int tZ2::delta ( void  ) const
inline

The delta function.

Definition at line 115 of file ringz2.h.

References _n.

◆ invert()

tZ2 & tZ2::invert ( )
inline

Inverts the ring element.

Definition at line 125 of file ringz2.h.

References _n.

◆ negate()

tZ2 & tZ2::negate ( )
inline

Negates the ring element.

Definition at line 120 of file ringz2.h.

◆ operator int()

tZ2::operator int ( ) const
inline

Conversion to an integer.

Note that in some rings this conversion may not be valid.

Definition at line 110 of file ringz2.h.

References _n.

◆ operator*=()

tZ2 & tZ2::operator*= ( const tZ2 another)
inline

Multiplies by another ring element.

Definition at line 139 of file ringz2.h.

References _n.

◆ operator+=()

tZ2 & tZ2::operator+= ( const tZ2 another)
inline

Adds another ring element.

Definition at line 132 of file ringz2.h.

References _n.

◆ ringsymbol()

std::string tZ2::ringsymbol ( )
inlinestatic

Returns the symbol of the ring.

Definition at line 156 of file ringz2.h.

◆ swap()

void tZ2::swap ( tZ2 another)
inline

Swaps the internal data with another ring element.

Definition at line 146 of file ringz2.h.

References _n.

Friends And Related Function Documentation

◆ divide

bool divide ( const tZ2 a,
const tZ2 b,
tZ2 quotient,
tZ2 remainder 
)
friend

Performs the division with remainder in the ring.

Returns true if the remainer is zero, false otherwise.

Member Data Documentation

◆ _n

bool tZ2::_n
private

The number corresponding to the ring element.

Definition at line 92 of file ringz2.h.

Referenced by delta(), invert(), operator int(), operator*=(), operator+=(), swap(), and tZ2().


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