NZMATH  1.2.0
About: NZMATH is a Python based number theory oriented calculation system.
  Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

nzmath.finitefield.FinitePrimeField Class Reference
Inheritance diagram for nzmath.finitefield.FinitePrimeField:
[legend]
Collaboration diagram for nzmath.finitefield.FinitePrimeField:
[legend]

Public Member Functions

def __init__ (self, characteristic)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def __ne__ (self, other)
 
def __str__ (self)
 
def __repr__ (self)
 
def __hash__ (self)
 
def issubring (self, other)
 
def issuperring (self, other)
 
def __contains__ (self, elem)
 
def createElement (self, seed)
 
def primitive_element (self)
 
def Legendre (self, element)
 
def SquareRoot (self, element)
 
def card (self)
 
def getInstance (cls, characteristic)
 
- Public Member Functions inherited from nzmath.finitefield.FiniteField
def getCharacteristic (self)
 
def order (self, elem)
 
def random_element (self, *args)
 
def TonelliShanks (self, element)
 
def sqrt (self, element)
 
- Public Member Functions inherited from nzmath.ring.Field
def __init__ (self)
 
def createElement (self, *args)
 
def isfield (self)
 
def gcd (self, a, b)
 
def getQuotientField (self)
 
- Public Member Functions inherited from nzmath.ring.CommutativeRing
def isdomain (self)
 
def isnoetherian (self)
 
def isufd (self)
 
def ispid (self)
 
def iseuclidean (self)
 
def registerModuleAction (self, action_ring, action)
 
def hasaction (self, action_ring)
 
def getaction (self, action_ring)
 
- Public Member Functions inherited from nzmath.ring.Ring
def getCommonSuperring (self, other)
 

Public Attributes

 char
 
- Public Attributes inherited from nzmath.finitefield.FiniteField
 char
 
- Public Attributes inherited from nzmath.ring.CommutativeRing
 properties
 

Properties

 one = property(_getOne, None, None, "multiplicative unit.")
 
 zero = property(_getZero, None, None, "additive unit.")
 

Private Member Functions

def _getOne (self)
 
def _getZero (self)
 

Static Private Member Functions

def _int_times (integer, fpelem)
 
def _rat_times (rat, fpelem)
 

Private Attributes

 _orderfactor
 
 _one
 
 _zero
 

Static Private Attributes

dictionary _instances = {}
 

Detailed Description

FinitePrimeField is also known as F_p or GF(p).

Definition at line 205 of file finitefield.py.

Constructor & Destructor Documentation

◆ __init__()

def nzmath.finitefield.FinitePrimeField.__init__ (   self,
  characteristic 
)

Member Function Documentation

◆ __contains__()

def nzmath.finitefield.FinitePrimeField.__contains__ (   self,
  elem 
)

Definition at line 277 of file finitefield.py.

References nzmath.finitefield.FiniteField.char.

◆ __eq__()

◆ __hash__() [1/2]

def nzmath.finitefield.FinitePrimeField.__hash__ (   self)

Reimplemented from nzmath.ring.Ring.

Definition at line 241 of file finitefield.py.

References nzmath.finitefield.FiniteField.char.

Referenced by nzmath.finitefield.FinitePrimeField.__hash__().

◆ __hash__() [2/2]

def nzmath.finitefield.FinitePrimeField.__hash__ (   self)

◆ __ne__()

def nzmath.finitefield.FinitePrimeField.__ne__ (   self,
  other 
)
Inequality test.

Reimplemented from nzmath.ring.Ring.

Definition at line 244 of file finitefield.py.

◆ __repr__()

◆ __str__()

def nzmath.finitefield.FinitePrimeField.__str__ (   self)

Definition at line 247 of file finitefield.py.

References nzmath.finitefield.FiniteField.char.

◆ _getOne()

def nzmath.finitefield.FinitePrimeField._getOne (   self)
private

◆ _getZero()

def nzmath.finitefield.FinitePrimeField._getZero (   self)
private

◆ _int_times()

def nzmath.finitefield.FinitePrimeField._int_times (   integer,
  fpelem 
)
staticprivate
Return k * FinitePrimeFieldElement(n, p)

Definition at line 221 of file finitefield.py.

Referenced by nzmath.finitefield.FinitePrimeField.__init__().

◆ _rat_times()

def nzmath.finitefield.FinitePrimeField._rat_times (   rat,
  fpelem 
)
staticprivate
Return Rational(a, b) * FinitePrimeFieldElement(n, p)

Definition at line 228 of file finitefield.py.

Referenced by nzmath.finitefield.FinitePrimeField.__init__().

◆ card()

def nzmath.finitefield.FinitePrimeField.card (   self)

◆ createElement()

def nzmath.finitefield.FinitePrimeField.createElement (   self,
  seed 
)
Create an element of the field.

'seed' should be an integer.

Reimplemented from nzmath.ring.Ring.

Definition at line 282 of file finitefield.py.

References nzmath.finitefield.FiniteField.char.

Referenced by nzmath.finitefield.FiniteField.random_element(), and nzmath.finitefield.FiniteField.TonelliShanks().

◆ getInstance()

def nzmath.finitefield.FinitePrimeField.getInstance (   cls,
  characteristic 
)
Return an instance of the class with specified characteristic.

Definition at line 349 of file finitefield.py.

References nzmath.finitefield.FinitePrimeField._instances.

◆ issubring()

def nzmath.finitefield.FinitePrimeField.issubring (   self,
  other 
)
Report whether another ring contains the field as a subring.

Reimplemented from nzmath.ring.Ring.

Definition at line 256 of file finitefield.py.

References nzmath.finitefield.FiniteField.char.

Referenced by nzmath.ring.Ring.getCommonSuperring(), nzmath.rational.RationalField.getCommonSuperring(), and nzmath.rational.IntegerRing.getCommonSuperring().

◆ issuperring()

◆ Legendre()

def nzmath.finitefield.FinitePrimeField.Legendre (   self,
  element 
)
Return generalize Legendre Symbol for FinitePrimeField.

Reimplemented from nzmath.finitefield.FiniteField.

Definition at line 308 of file finitefield.py.

◆ primitive_element()

def nzmath.finitefield.FinitePrimeField.primitive_element (   self)
Return a primitive element of the field, i.e., a generator of
the multiplicative group.

Reimplemented from nzmath.finitefield.FiniteField.

Definition at line 290 of file finitefield.py.

References nzmath.finitefield.FiniteField._orderfactor, nzmath.finitefield.FinitePrimeField.card(), nzmath.finitefield.FiniteField.char, nzmath.algfield.NumberField.one, and nzmath.finitefield.FinitePrimeField.one.

◆ SquareRoot()

def nzmath.finitefield.FinitePrimeField.SquareRoot (   self,
  element 
)
Return square root if exist.

Definition at line 318 of file finitefield.py.

Member Data Documentation

◆ _instances

◆ _one

◆ _orderfactor

nzmath.finitefield.FinitePrimeField._orderfactor
private

Definition at line 299 of file finitefield.py.

◆ _zero

◆ char

nzmath.finitefield.FinitePrimeField.char

Definition at line 238 of file finitefield.py.

Property Documentation

◆ one

◆ zero

nzmath.finitefield.FinitePrimeField.zero = property(_getZero, None, None, "additive unit.")
static

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