|
The ChainCon Software (Release 0.03)
|
An element of the ring Z_p, where p is globally set. More...
#include <ringzp.h>
Public Member Functions | |
| tZp () | |
| Default constructor of a ring element. More... | |
| tZp (const intType &n) | |
| Constructor from an integer number (to be used mainly for 0 or 1). More... | |
| operator intType () const | |
| Conversion to an integer. More... | |
| intType | delta () const |
| The delta function. More... | |
| tZp< intType > & | negate () |
| Negates the ring element. More... | |
| tZp< intType > & | invert () |
| Inverts the ring element. Assumes that 'p' is a prime number. More... | |
| tZp< intType > & | operator+= (const tZp< intType > &another) |
| Adds another ring element. More... | |
| tZp< intType > & | operator*= (const tZp< intType > &another) |
| Multiplies by another ring element. More... | |
| void | swap (tZp< intType > &another) |
| Swaps the internal data with another ring element. More... | |
Static Public Member Functions | |
| static void | setp (const intType &p) |
| Sets the number p for the ring. More... | |
| static const intType & | getp () |
| Gets the currently set number p for the ring. More... | |
| static std::string | ringsymbol () |
| Returns the symbol of the ring. More... | |
Private Attributes | |
| intType | _n |
| The number corresponding to the ring element. More... | |
Static Private Attributes | |
| static intType | _p = 2 |
| The number that defines the ring. More... | |
Friends | |
| bool | divide (const tZp< intType > &a, const tZp< intType > &b, tZp< intType > "ient, tZp< intType > &remainder) |
| Performs the division with remainder in the ring. More... | |
An element of the ring Z_p, where p is globally set.
Set p=0 for the ring Z (note the limited range of valid values). In this implementation, p must be set smaller than the square root of the largest positive number that can be encoded in the underlying integer type.
|
inline |
|
inlinestatic |
Inverts the ring element. Assumes that 'p' is a prime number.
Definition at line 347 of file ringzp.h.
References invertModuloSmallP().
Referenced by divide().
|
inline |
|
inlinestatic |
|
inlinestatic |
Sets the number p for the ring.
Definition at line 389 of file ringzp.h.
References numberIsPrime().
|
private |
|
staticprivate |
1.8.13