|
CGAL 6.2 - Number Types
|
#include <CGAL/Zp.h>
The class Zp implements the concept IntegralDomainWithoutDivision with the ring \(\mathbb Z/p\mathbb Z\) (which is a field when pis prime).
This is a "lightweight" implementation which aims at providing fast operations and constructors.
According to the value of p, users can chose the size of the representation used to store values (default size: int).
Z2 which is optimized.IntegralDomainWithoutDivision | p | a positive integer. |
| T | a type used for the inner storage of the values (default: int). |
| IsPrime | a bool encoding wether p is a prime number or not. |
Public Member Functions | |
| Zp (T i=0) | |
| Constructor from a value. | |
| Zp (const Zp &a) | |
| bool | is_zero () const |
| Tests if the element is 0. | |
| Zp & | operator= (const Zp &a) |
| Operator=. | |
| Zp & | operator+= (const Zp &a) |
| Operator+=. | |
| Zp & | operator-= (const Zp &a) |
| Operator-=. | |
| Zp & | operator*= (const Zp &a) |
| Operator*=. | |
| Zp & | operator/= (const Zp &a) |
| Operator/=. | |
| bool | is_invertible () |
| Returns the invertibility of the element. | |
Static Public Member Functions | |
| static T | operator() () |
| Returns the value of p. | |
Friends | |
| Zp | operator+ (const Zp &a) |
| Unary operator+. | |
| Zp | operator- (const Zp &a) |
| Unary operator-. | |
| Zp | operator+ (const Zp &a, const Zp &b) |
| Operator+. | |
| Zp | operator- (const Zp &a, const Zp &b) |
| Operator-. | |
| Zp | operator* (const Zp &a, const Zp &b) |
| Operator*. | |
| Zp | operator/ (const Zp &a, const Zp &b) |
| Operator/. | |
| bool | operator== (const Zp &a, const Zp &b) |
| Operator==. | |
| bool | operator!= (const Zp &a, const Zp &b) |
| Operator!=. | |
| Zp | abs (const Zp &a) |
| Absolute value. | |
| std::ostream & | operator<< (std::ostream &out, const Zp &a) |
| Operator<<. | |
| std::istream & | operator>> (std::istream &in, Zp &a) |
| Operator>>. | |