Mackey  V3.3
A C++ library for computing RO(G) graded homology
Z_mod< N, T > Class Template Reference

The class of Z/N coefficients where N is prime. More...

#include <Z_n.hpp>

Public Member Functions

 Z_mod ()
 Default value 0. More...
 
 Z_mod (bool x)
 Initialize from 0,1. More...
 
 Z_mod (int x)
 Initialize from int. More...
 
 Z_mod (int64_t x)
 Initialize from 64bit int. More...
 
 operator char () const
 
 operator short () const
 
 operator int () const
 
 operator int64_t () const
 
 operator unsigned char () const
 
 operator unsigned short () const
 
 operator unsigned int () const
 
 operator uint64_t () const
 
Z_mod< N, T > operator+ (Z_mod< N, T > b) const
 
Z_mod< N, T > operator- (Z_mod< N, T > b) const
 
Z_mod< N, T > & operator+= (Z_mod< N, T > b)
 
Z_mod< N, T > & operator-= (Z_mod< N, T > b)
 
Z_mod< N, T > & operator*= (Z_mod< N, T > b)
 
Z_mod< N, T > & operator/= (Z_mod< N, T > b)
 
bool operator== (Z_mod< N, T > a) const
 
bool operator!= (Z_mod< N, T > a) const
 
bool operator<= (Z_mod< N, T > a) const
 Needed for Eigen pruning; standard order on 0,...,N-1. More...
 

Public Attributes

x
 A modulo N number. More...
 

Static Public Attributes

constexpr static int64_t order = N
 The N of Z/N. More...
 

Detailed Description

template<int64_t N, typename T = int64_t>
class mackey::Z_mod< N, T >

The class of Z/N coefficients where N is prime.

The operators are self explanatory. User must ensure that N is prime for division to work.

Constructor & Destructor Documentation

◆ Z_mod() [1/4]

Z_mod ( )
inline

Default value 0.

◆ Z_mod() [2/4]

Z_mod ( bool  x)
inline

Initialize from 0,1.

◆ Z_mod() [3/4]

Z_mod ( int  x)

Initialize from int.

◆ Z_mod() [4/4]

Z_mod ( int64_t  x)

Initialize from 64bit int.

Member Function Documentation

◆ operator char()

operator char ( ) const
explicit

◆ operator short()

operator short ( ) const
explicit

◆ operator int()

operator int ( ) const
explicit

◆ operator int64_t()

operator int64_t ( ) const
explicit

◆ operator unsigned char()

operator unsigned char ( ) const
explicit

◆ operator unsigned short()

operator unsigned short ( ) const
explicit

◆ operator unsigned int()

operator unsigned int ( ) const
explicit

◆ operator uint64_t()

operator uint64_t ( ) const
explicit

◆ operator+()

Z_mod<N, T> operator+ ( Z_mod< N, T >  b) const

◆ operator-()

Z_mod<N, T> operator- ( Z_mod< N, T >  b) const

◆ operator+=()

Z_mod<N, T>& operator+= ( Z_mod< N, T >  b)

◆ operator-=()

Z_mod<N, T>& operator-= ( Z_mod< N, T >  b)

◆ operator*=()

Z_mod<N, T>& operator*= ( Z_mod< N, T >  b)

◆ operator/=()

Z_mod<N, T>& operator/= ( Z_mod< N, T >  b)

◆ operator==()

bool operator== ( Z_mod< N, T >  a) const

◆ operator!=()

bool operator!= ( Z_mod< N, T >  a) const

◆ operator<=()

bool operator<= ( Z_mod< N, T >  a) const

Needed for Eigen pruning; standard order on 0,...,N-1.

Member Data Documentation

◆ order

constexpr static int64_t order = N
staticconstexpr

The N of Z/N.

◆ x

T x

A modulo N number.


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