Basic Polynomial Algebra Subprograms (BPAS)  v. 1.791
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GeneralizedFermatPrimeField Class Reference

A finite field whose prime should be a generalized fermat number. More...

#include <GeneralizedFermatPrimeField.hpp>

Simplified semantic inheritance diagram for GeneralizedFermatPrimeField:
- Full inheritance diagram for GeneralizedFermatPrimeField:

Public Member Functions

 GeneralizedFermatPrimeField (mpz_class a)
 GeneralizedFermatPrimeField (int a)
 GeneralizedFermatPrimeField (const GeneralizedFermatPrimeField &c)
 GeneralizedFermatPrimeField (const Integer &c)
 GeneralizedFermatPrimeField (const RationalNumber &c)
 GeneralizedFermatPrimeField (const SmallPrimeField &c)
 GeneralizedFermatPrimeField (const BigPrimeField &c)
 GeneralizedFermatPrimeField (const DenseUnivariateIntegerPolynomial &c)
 GeneralizedFermatPrimeField (const DenseUnivariateRationalPolynomial &c)
 GeneralizedFermatPrimeField (const SparseUnivariatePolynomial< Integer > &c)
 GeneralizedFermatPrimeField (const SparseUnivariatePolynomial< RationalNumber > &c)
 GeneralizedFermatPrimeField (const SparseUnivariatePolynomial< ComplexRationalNumber > &c)
template<class Ring >
 GeneralizedFermatPrimeField (const SparseUnivariatePolynomial< Ring > &c)
GeneralizedFermatPrimeFieldGPFpointer (GeneralizedFermatPrimeField *a)
GeneralizedFermatPrimeFieldGPFpointer (RationalNumber *a)
GeneralizedFermatPrimeFieldGPFpointer (SmallPrimeField *a)
GeneralizedFermatPrimeFieldGPFpointer (BigPrimeField *a)
mpz_class getCharacteristic () const override
 The characteristic of this ring class.
void setX (mpz_class a)
mpz_class Prime () const
mpz_class number () const
GeneralizedFermatPrimeField unitCanonical (GeneralizedFermatPrimeField *u=NULL, GeneralizedFermatPrimeField *v=NULL) const
 Obtain the unit normal (a.k.a canonical associate) of an element. More...
GeneralizedFermatPrimeField findPrimitiveRootOfUnity (long int n) const
GeneralizedFermatPrimeFieldoperator= (const GeneralizedFermatPrimeField &c)
 Copy assignment.
GeneralizedFermatPrimeFieldoperator= (const mpz_class &c)
GeneralizedFermatPrimeFieldoperator= (int c)
bool isZero () const
 Determine if *this ring element is zero, that is the additive identity. More...
void zero ()
 Make *this ring element zero.
bool isOne () const
 Determine if *this ring element is one, that is the multiplication identity. More...
void one ()
 Make *this ring element one.
bool isNegativeOne () const
void negativeOne ()
int isConstant () const
bool operator== (const GeneralizedFermatPrimeField &c) const
 Equality test,. More...
bool operator== (const mpz_class &c) const
bool operator!= (const GeneralizedFermatPrimeField &c) const
 Inequality test,. More...
bool operator!= (const mpz_class &c) const
GeneralizedFermatPrimeField operator+ (const GeneralizedFermatPrimeField &c) const
GeneralizedFermatPrimeField operator+ (const mpz_class &c) const
GeneralizedFermatPrimeFieldoperator+= (const mpz_class &c)
GeneralizedFermatPrimeField operator+ (int c) const
GeneralizedFermatPrimeFieldoperator+= (int c)
GeneralizedFermatPrimeFieldoperator+= (const GeneralizedFermatPrimeField &y)
 Addition assignment.
GeneralizedFermatPrimeField operator- (const GeneralizedFermatPrimeField &c) const
GeneralizedFermatPrimeField operator- (const mpz_class &c) const
GeneralizedFermatPrimeFieldoperator-= (const mpz_class &c)
GeneralizedFermatPrimeField operator- (int c) const
GeneralizedFermatPrimeFieldoperator-= (int c)
GeneralizedFermatPrimeFieldoperator-= (const GeneralizedFermatPrimeField &y)
 Subtraction assignment.
GeneralizedFermatPrimeField operator- () const
void smallAdd2 (usfixn64 *xm, usfixn64 *ym, short &c)
void oneShiftRight (usfixn64 *xs)
void mulLong_2 (usfixn64 x, usfixn64 y, usfixn64 &s0, usfixn64 &s1, usfixn64 &s2)
void mulLong_3 (usfixn64 const &x, usfixn64 const &y, usfixn64 &s0, usfixn64 &s1, usfixn64 &s2)
void multiplication (usfixn64 *__restrict__ xs, const usfixn64 *__restrict__ ys, usfixn64 permutationStride, usfixn64 *lVector, usfixn64 *hVector, usfixn64 *cVector, usfixn64 *lVectorSub, usfixn64 *hVectorSub, usfixn64 *cVectorSub)
void multiplication_step2 (usfixn64 *__restrict__ xs, usfixn64 permutationStride, usfixn64 *__restrict__ lVector, usfixn64 *__restrict__ hVector, usfixn64 *__restrict__ cVector)
GeneralizedFermatPrimeField operator* (const GeneralizedFermatPrimeField &c) const
GeneralizedFermatPrimeField operator* (const mpz_class &c) const
GeneralizedFermatPrimeFieldoperator*= (const mpz_class &c)
GeneralizedFermatPrimeField operator* (int c) const
GeneralizedFermatPrimeFieldoperator*= (int c)
GeneralizedFermatPrimeFieldoperator*= (const GeneralizedFermatPrimeField &c)
 Multiplication assignment.
GeneralizedFermatPrimeField MultiP3 (GeneralizedFermatPrimeField ys)
GeneralizedFermatPrimeField MulPowR (int s)
void egcd (const mpz_class &x, const mpz_class &y, mpz_class *ao, mpz_class *bo, mpz_class *vo, mpz_class P)
GeneralizedFermatPrimeField inverse2 ()
GeneralizedFermatPrimeField operator^ (long long int c) const
GeneralizedFermatPrimeField operator^ (const mpz_class &exp) const
GeneralizedFermatPrimeFieldoperator^= (long long int c)
 Exponentiation assignment.
GeneralizedFermatPrimeFieldoperator^= (const mpz_class &c)
ExpressionTree convertToExpressionTree () const
 Convert this to an expression tree. More...
GeneralizedFermatPrimeField operator/ (const GeneralizedFermatPrimeField &c) const
 Exact division. More...
GeneralizedFermatPrimeField operator/ (long int c) const
GeneralizedFermatPrimeField operator/ (const mpz_class &c) const
GeneralizedFermatPrimeFieldoperator/= (const GeneralizedFermatPrimeField &c)
 Exact division assignment. More...
GeneralizedFermatPrimeFieldoperator/= (long int c)
GeneralizedFermatPrimeFieldoperator/= (const mpz_class &c)
GeneralizedFermatPrimeField operator% (const GeneralizedFermatPrimeField &c) const
 Get the remainder of *this and b;. More...
GeneralizedFermatPrimeFieldoperator%= (const GeneralizedFermatPrimeField &c)
 Assign *this to be the remainder of *this and b. More...
GeneralizedFermatPrimeField gcd (const GeneralizedFermatPrimeField &a) const
 Get GCD of *this and other. More...
Factors< GeneralizedFermatPrimeFieldsquareFree () const
 Compute squarefree factorization of *this.
Integer euclideanSize () const
 Get the euclidean size of *this.
GeneralizedFermatPrimeField euclideanDivision (const GeneralizedFermatPrimeField &b, GeneralizedFermatPrimeField *q=NULL) const
 Perform the eucldiean division of *this and b. More...
GeneralizedFermatPrimeField extendedEuclidean (const GeneralizedFermatPrimeField &b, GeneralizedFermatPrimeField *s=NULL, GeneralizedFermatPrimeField *t=NULL) const
 Perform the extended euclidean division on *this and b. More...
GeneralizedFermatPrimeField quotient (const GeneralizedFermatPrimeField &b) const
 Get the quotient of *this and b.
GeneralizedFermatPrimeField remainder (const GeneralizedFermatPrimeField &b) const
 Get the remainder of *this and b.
GeneralizedFermatPrimeField inverse () const
 Get the inverse of *this. More...

Static Public Member Functions

static void setPrime (mpz_class p, usfixn64 R, int K)
static mpz_class power (mpz_class xi, mpz_class yi)
static mpz_class findPrimitiveRootofUnity_plain (mpz_class n)
static GeneralizedFermatPrimeField findPrimitiveRootofUnity (mpz_class n)

Public Attributes

usfixn64 * x

Static Public Attributes

static mpz_class characteristic
static usfixn64 r
static int k

Detailed Description

A finite field whose prime should be a generalized fermat number.

That is, for r = (2^w +/- 2^u), the prime is r^k, for some k.

Member Function Documentation

◆ convertToExpressionTree()

ExpressionTree GeneralizedFermatPrimeField::convertToExpressionTree ( ) const

Convert this to an expression tree.

returns an expression tree describing *this.

Implements ExpressionTreeConvert.

◆ euclideanDivision()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::euclideanDivision ( const GeneralizedFermatPrimeField b,
GeneralizedFermatPrimeField q = NULL 
) const

Perform the eucldiean division of *this and b.

Returns the remainder. If q is not NULL, then returns the quotient in q.

Implements BPASEuclideanDomain< GeneralizedFermatPrimeField >.

◆ extendedEuclidean()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::extendedEuclidean ( const GeneralizedFermatPrimeField b,
GeneralizedFermatPrimeField s = NULL,
GeneralizedFermatPrimeField t = NULL 
) const

Perform the extended euclidean division on *this and b.

Returns the GCD. If s and t are not NULL, returns the bezout coefficients in them.

Implements BPASEuclideanDomain< GeneralizedFermatPrimeField >.

◆ gcd()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::gcd ( const GeneralizedFermatPrimeField other) const

Get GCD of *this and other.

otherthe other element to get a gcd with.
the gcd.

Implements BPASGCDDomain< GeneralizedFermatPrimeField >.

◆ inverse()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::inverse ( ) const

Get the inverse of *this.

the inverse

Implements BPASField< GeneralizedFermatPrimeField >.

◆ isOne()

bool GeneralizedFermatPrimeField::isOne ( ) const

Determine if *this ring element is one, that is the multiplication identity.

returns true iff *this is one.

Implements BPASRing< GeneralizedFermatPrimeField >.

◆ isZero()

bool GeneralizedFermatPrimeField::isZero ( ) const

Determine if *this ring element is zero, that is the additive identity.

returns true iff *this is zero.

Implements BPASRing< GeneralizedFermatPrimeField >.

◆ operator!=()

bool GeneralizedFermatPrimeField::operator!= ( const GeneralizedFermatPrimeField ) const

Inequality test,.

returns true iff not equal.

Implements BPASRing< GeneralizedFermatPrimeField >.

◆ operator%()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::operator% ( const GeneralizedFermatPrimeField b) const

Get the remainder of *this and b;.

bthe divisor
the remainder

Implements BPASEuclideanDomain< GeneralizedFermatPrimeField >.

◆ operator%=()

GeneralizedFermatPrimeField& GeneralizedFermatPrimeField::operator%= ( const GeneralizedFermatPrimeField b)

Assign *this to be the remainder of *this and b.

bthe divisor
this after assignment.

Implements BPASEuclideanDomain< GeneralizedFermatPrimeField >.

◆ operator/()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::operator/ ( const GeneralizedFermatPrimeField d) const

Exact division.

dthe divisor.
the equotient.

Implements BPASIntegralDomain< GeneralizedFermatPrimeField >.

◆ operator/=()

GeneralizedFermatPrimeField& GeneralizedFermatPrimeField::operator/= ( const GeneralizedFermatPrimeField d)

Exact division assignment.

dthe divisor.
a reference to this after assignment.

Implements BPASIntegralDomain< GeneralizedFermatPrimeField >.

◆ operator==()

bool GeneralizedFermatPrimeField::operator== ( const GeneralizedFermatPrimeField ) const

Equality test,.

returns true iff equal

Implements BPASRing< GeneralizedFermatPrimeField >.

◆ unitCanonical()

GeneralizedFermatPrimeField GeneralizedFermatPrimeField::unitCanonical ( GeneralizedFermatPrimeField u = NULL,
GeneralizedFermatPrimeField v = NULL 
) const

Obtain the unit normal (a.k.a canonical associate) of an element.

If either parameters u, v, are non-NULL then the units are returned such that b = ua, v = u^-1. Where b is the unit normal of a, and is the returned value.

Implements BPASRing< GeneralizedFermatPrimeField >.

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