Aerobus v1.2
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Attributes | List of all members
aerobus::zpz< p > Struct Template Reference

congruence classes of integers modulo p (32 bits) More...

#include <aerobus.h>

Classes

struct  val
 values in zpz More...
 

Public Types

using inner_type = int32_t
 underlying type for values
 
template<auto x>
using inject_constant_t = val< static_cast< int32_t >(x)>
 injects a constant integer into zpz
 
using zero = val< 0 >
 zero value
 
using one = val< 1 >
 one value
 
template<typename v1 , typename v2 >
using add_t = typename add< v1, v2 >::type
 addition operator
 
template<typename v1 , typename v2 >
using sub_t = typename sub< v1, v2 >::type
 substraction operator
 
template<typename v1 , typename v2 >
using mul_t = typename mul< v1, v2 >::type
 multiplication operator
 
template<typename v1 , typename v2 >
using div_t = typename div< v1, v2 >::type
 division operator
 
template<typename v1 , typename v2 >
using mod_t = typename remainder< v1, v2 >::type
 modulo operator
 
template<typename v1 , typename v2 >
using gt_t = typename gt< v1, v2 >::type
 strictly greater operator (type)
 
template<typename v1 , typename v2 >
using lt_t = typename lt< v1, v2 >::type
 strictly smaller operator (type)
 
template<typename v1 , typename v2 >
using eq_t = typename eq< v1, v2 >::type
 equality operator (type)
 
template<typename v1 , typename v2 >
using gcd_t = gcd_t< i32, v1, v2 >
 greatest common divisor
 
template<typename v1 >
using pos_t = typename pos< v1 >::type
 positivity operator (type)
 

Static Public Attributes

static constexpr bool is_field = is_prime<p>::value
 true iff p is prime
 
static constexpr bool is_euclidean_domain = true
 always true
 
template<typename v1 , typename v2 >
static constexpr bool gt_v = gt_t<v1, v2>::value
 strictly greater operator (booleanvalue)
 
template<typename v1 , typename v2 >
static constexpr bool lt_v = lt_t<v1, v2>::value
 strictly smaller operator (booleanvalue)
 
template<typename v1 , typename v2 >
static constexpr bool eq_v = eq_t<v1, v2>::value
 equality operator (booleanvalue)
 
template<typename v >
static constexpr bool pos_v = pos_t<v>::value
 positivity operator (boolean value)
 

Detailed Description

template<int32_t p>
struct aerobus::zpz< p >

congruence classes of integers modulo p (32 bits)

if p is prime, zpz

is a field

Template Parameters
pa integer
Examples
examples/modular_arithmetic.cpp, and examples/polynomials_over_finite_field.cpp.

Member Typedef Documentation

◆ add_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::add_t = typename add<v1, v2>::type

addition operator

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ div_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::div_t = typename div<v1, v2>::type

division operator

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ eq_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::eq_t = typename eq<v1, v2>::type

equality operator (type)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ gcd_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::gcd_t = gcd_t<i32, v1, v2>

greatest common divisor

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ gt_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::gt_t = typename gt<v1, v2>::type

strictly greater operator (type)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ inject_constant_t

template<int32_t p>
template<auto x>
using aerobus::zpz< p >::inject_constant_t = val<static_cast<int32_t>(x)>

injects a constant integer into zpz

Template Parameters
xan integer

◆ inner_type

template<int32_t p>
using aerobus::zpz< p >::inner_type = int32_t

underlying type for values

◆ lt_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::lt_t = typename lt<v1, v2>::type

strictly smaller operator (type)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ mod_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::mod_t = typename remainder<v1, v2>::type

modulo operator

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ mul_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::mul_t = typename mul<v1, v2>::type

multiplication operator

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ one

template<int32_t p>
using aerobus::zpz< p >::one = val<1>

one value

◆ pos_t

template<int32_t p>
template<typename v1 >
using aerobus::zpz< p >::pos_t = typename pos<v1>::type

positivity operator (type)

Template Parameters
v1a value in zpz::val

◆ sub_t

template<int32_t p>
template<typename v1 , typename v2 >
using aerobus::zpz< p >::sub_t = typename sub<v1, v2>::type

substraction operator

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ zero

template<int32_t p>
using aerobus::zpz< p >::zero = val<0>

zero value

Member Data Documentation

◆ eq_v

template<int32_t p>
template<typename v1 , typename v2 >
constexpr bool aerobus::zpz< p >::eq_v = eq_t<v1, v2>::value
staticconstexpr

equality operator (booleanvalue)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ gt_v

template<int32_t p>
template<typename v1 , typename v2 >
constexpr bool aerobus::zpz< p >::gt_v = gt_t<v1, v2>::value
staticconstexpr

strictly greater operator (booleanvalue)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ is_euclidean_domain

template<int32_t p>
constexpr bool aerobus::zpz< p >::is_euclidean_domain = true
staticconstexpr

always true

◆ is_field

template<int32_t p>
constexpr bool aerobus::zpz< p >::is_field = is_prime<p>::value
staticconstexpr

true iff p is prime

◆ lt_v

template<int32_t p>
template<typename v1 , typename v2 >
constexpr bool aerobus::zpz< p >::lt_v = lt_t<v1, v2>::value
staticconstexpr

strictly smaller operator (booleanvalue)

Template Parameters
v1a value in zpz::val
v2a value in zpz::val

◆ pos_v

template<int32_t p>
template<typename v >
constexpr bool aerobus::zpz< p >::pos_v = pos_t<v>::value
staticconstexpr

positivity operator (boolean value)

Template Parameters
v1a value in zpz::val

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