CGAL 6.3-dev - 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)=default
char operator() ()
 Returns 2 (ie. p such that Z2= \(\mathbb Z/2\mathbb Z\)).
bool is_zero () const
Z2 & operator+= (const Z2 &a)
 Operator+=.
Z2 & operator-= (const Z2 &a)
 Operator-=.
Z2 & operator*= (const Z2 &a)
 Operator*=.
Z2 & operator/= (const Z2 &a)
 Operator/=.
bool is_invertible () const
 Returns the invertibility of the element.
Z2 inverse () const
 For invertible values, returns the inverse.

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>>.