carl  24.04
Computer ARithmetic Library
carl::GaloisField< IntegerType > Class Template Reference

A finite field. More...

#include <GaloisField.h>

Inheritance diagram for carl::GaloisField< IntegerType >:

Public Types

using BaseIntType = unsigned
 

Public Member Functions

 GaloisField (BaseIntType p, BaseIntType k=1)
 Creating the field Z_{p^k}. More...
 
BaseIntType p () const noexcept
 Returns the p from Z_{p^k}. More...
 
BaseIntType k () const noexcept
 Returns the k from Z_{p^k}. More...
 
const IntegerType & size () const noexcept
 
IntegerType modulo (const IntegerType &n) const
 
IntegerType symmetric_modulo (const IntegerType &n) const
 

Private Attributes

const BaseIntType mP
 
const BaseIntType mK
 
const IntegerType mPK
 
const IntegerType mMaxValue
 
const IntegerType mModulus
 

Friends

bool operator== (const GaloisField &lhs, const GaloisField &rhs)
 
std::ostream & operator<< (std::ostream &os, const GaloisField &rhs)
 

Detailed Description

template<typename IntegerType>
class carl::GaloisField< IntegerType >

A finite field.

Definition at line 32 of file GaloisField.h.

Member Typedef Documentation

◆ BaseIntType

template<typename IntegerType >
using carl::GaloisField< IntegerType >::BaseIntType = unsigned

Definition at line 34 of file GaloisField.h.

Constructor & Destructor Documentation

◆ GaloisField()

template<typename IntegerType >
carl::GaloisField< IntegerType >::GaloisField ( BaseIntType  p,
BaseIntType  k = 1 
)
inlineexplicit

Creating the field Z_{p^k}.

Parameters
pA prime number
kA exponent
See also
GaloisFieldManager where the overhead of creating several GFs is prevented by storing them.

Definition at line 49 of file GaloisField.h.

Member Function Documentation

◆ k()

template<typename IntegerType >
BaseIntType carl::GaloisField< IntegerType >::k ( ) const
inlinenoexcept

Returns the k from Z_{p^k}.

Returns
A positive integer

Definition at line 69 of file GaloisField.h.

Here is the caller graph for this function:

◆ modulo()

template<typename IntegerType >
IntegerType carl::GaloisField< IntegerType >::modulo ( const IntegerType &  n) const
inline

Definition at line 77 of file GaloisField.h.

Here is the call graph for this function:

◆ p()

template<typename IntegerType >
BaseIntType carl::GaloisField< IntegerType >::p ( ) const
inlinenoexcept

Returns the p from Z_{p^k}.

Returns
a prime

Definition at line 61 of file GaloisField.h.

Here is the caller graph for this function:

◆ size()

template<typename IntegerType >
const IntegerType& carl::GaloisField< IntegerType >::size ( ) const
inlinenoexcept

Definition at line 73 of file GaloisField.h.

◆ symmetric_modulo()

template<typename IntegerType >
IntegerType carl::GaloisField< IntegerType >::symmetric_modulo ( const IntegerType &  n) const
inline

Definition at line 81 of file GaloisField.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

template<typename IntegerType >
std::ostream& operator<< ( std::ostream &  os,
const GaloisField< IntegerType > &  rhs 
)
friend

Definition at line 93 of file GaloisField.h.

◆ operator==

template<typename IntegerType >
bool operator== ( const GaloisField< IntegerType > &  lhs,
const GaloisField< IntegerType > &  rhs 
)
friend

Definition at line 89 of file GaloisField.h.

Field Documentation

◆ mK

template<typename IntegerType >
const BaseIntType carl::GaloisField< IntegerType >::mK
private

Definition at line 37 of file GaloisField.h.

◆ mMaxValue

template<typename IntegerType >
const IntegerType carl::GaloisField< IntegerType >::mMaxValue
private

Definition at line 39 of file GaloisField.h.

◆ mModulus

template<typename IntegerType >
const IntegerType carl::GaloisField< IntegerType >::mModulus
private

Definition at line 40 of file GaloisField.h.

◆ mP

template<typename IntegerType >
const BaseIntType carl::GaloisField< IntegerType >::mP
private

Definition at line 36 of file GaloisField.h.

◆ mPK

template<typename IntegerType >
const IntegerType carl::GaloisField< IntegerType >::mPK
private

Definition at line 38 of file GaloisField.h.


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