CGAL 6.2 - Number Types
Loading...
Searching...
No Matches
CGAL::Z2 Class Reference

#include <CGAL/Z2.h>

Definition

The class Z2 implements the concept IntegralDomainWithoutDivision with the field \(\mathbb Z/2\mathbb Z\).

This implementation is optimized to use bitwise operations and should be prefered to Zp<2>.

Is model of
IntegralDomainWithoutDivision

Public Member Functions

 Z2 (char i=0)
 Constructor from a value.
 
 Z2 (const Z2 &a)
 
bool is_zero () const
 
Z2operator+= (const Z2 &a)
 Operator+=.
 
Z2operator-= (const Z2 &a)
 Operator-=.
 
Z2operator*= (const Z2 &a)
 Operator*=.
 
Z2operator/= (const Z2 &a)
 Operator/=.
 

Static Public Member Functions

static char operator() ()
 Returns 2 (ie. p such that Z2= \(\mathbb Z/2\mathbb Z\)).
 

Friends

Z2 operator+ (const Z2 &a)
 Unary operator+.
 
Z2 operator- (const Z2 &a)
 Unary operator-.
 
Z2 operator+ (const Z2 &a, const Z2 &b)
 Operator+.
 
Z2 operator- (const Z2 &a, const Z2 &b)
 Operator-.
 
Z2 operator* (const Z2 &a, const Z2 &b)
 Operator*.
 
Z2 operator/ (const Z2 &a, const Z2 &b)
 Operator/.
 
bool operator== (const Z2 &a, const Z2 &b)
 Operator==.
 
bool operator!= (const Z2 &a, const Z2 &b)
 Operator!=.
 
std::ostream & operator<< (std::ostream &out, const Z2 &a)
 Operator<<.
 
std::istream & operator>> (std::istream &in, Z2 &a)
 Operator>>.