Givaro
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
Modular< Log16 > Class Reference

This class implement the standard arithmetic with Modulo Elements. More...

#include <modular-log16.h>

Public Types

enum  { size_rep = sizeof(Residu_t) }
 
using Storage_t = int16_t
 
using Compute_t = int16_t
 
using Residu_t = uint16_t
 
using Element = Storage_t
 
using Element_ptr = Element *
 
using ConstElement = const Element
 
using ConstElement_ptr = const Element *
 
using Self_t = Modular< Log16 >
 
using Parent_t = Modular_implem< Storage_t, Compute_t, Residu_t >
 
typedef int16_t Power_t
 
typedef Power_t Rep
 
typedef ModularRandIter< Self_tRandIter
 
typedef GeneralRingNonZeroRandIter< Self_tNonZeroRandIter
 

Public Member Functions

 Modular (Residu_t p=2)
 
 Modular (const Modular< Log16 > &F)
 
 ~Modular ()
 
bool operator== (const Modular< Log16 > &BC) const
 
bool operator!= (const Modular< Log16 > &BC) const
 
Modular< Log16 > & operator= (const Modular< Log16 > &F)
 
Residu_t residu () const
 
Residu_t size () const
 
Element minElement () const
 
Element maxElement () const
 
Residu_t characteristic () const
 
Residu_t cardinality () const
 
template<class T >
T & characteristic (T &p) const
 
template<class T >
T & cardinality (T &p) const
 
int16_t & convert (int16_t &x, const Rep a) const
 
uint16_t & convert (uint16_t &x, const Rep a) const
 
uint32_t & convert (uint32_t &x, const Rep a) const
 
int32_t & convert (int32_t &x, const Rep a) const
 
uint64_t & convert (uint64_t &x, const Rep a) const
 
int64_t & convert (int64_t &x, const Rep a) const
 
double & convert (double &x, const Rep a) const
 
Integerconvert (Integer &i, const Rep a) const
 
Repinit (Rep &r) const
 
Repinit (Rep &r, const int64_t a) const
 
Repinit (Rep &a, const int32_t i) const
 
Repinit (Rep &r, const uint64_t a) const
 
Repinit (Rep &a, const uint32_t i) const
 
Repinit (Rep &a, const Integer &i) const
 
Repinit (Rep &a, const double i) const
 
Repinit (Rep &a, const float i) const
 
Repinit (Rep &a, const int16_t i) const
 
Repinit (Rep &r, const uint16_t a) const
 
Repassign (Rep &r, const Rep &a) const
 
bool isZero (const Rep a) const
 
bool isOne (const Rep a) const
 
bool isUnit (const Rep a) const
 
bool isMOne (const Rep a) const
 
size_t length (const Rep a) const
 
bool areEqual (const Element &a, const Element &b) const
 
Repmul (Rep &r, const Rep &a, const Rep &b) const
 
Repdiv (Rep &r, const Rep &a, const Rep &b) const
 
Repadd (Rep &r, const Rep &a, const Rep &b) const
 
Repsub (Rep &r, const Rep &a, const Rep &b) const
 
Repneg (Rep &r, const Rep &a) const
 
Repinv (Rep &r, const Rep &a) const
 
Repmulin (Rep &r, const Rep &a) const
 
Repdivin (Rep &r, const Rep &a) const
 
Repaddin (Rep &r, const Rep &a) const
 
Repsubin (Rep &r, const Rep &a) const
 
Repnegin (Rep &r) const
 
Repinvin (Rep &r) const
 
Repaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repaxpyin (Rep &r, const Rep &a, const Rep &b) const
 
Repaxmy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repaxmyin (Rep &r, const Rep &a, const Rep &b) const
 
Repmaxpy (Rep &r, const Rep &a, const Rep &b, const Rep &c) const
 
Repmaxpyin (Rep &r, const Rep &a, const Rep &b) const
 
template<class Random >
Elementrandom (Random &g, Element &r) const
 
template<class Random >
Elementnonzerorandom (Random &g, Element &a) const
 
std::istream & read (std::istream &s)
 
std::ostream & write (std::ostream &s) const
 
std::istream & read (std::istream &s, Rep &a) const
 
std::ostream & write (std::ostream &s, const Rep a) const
 

Static Public Member Functions

static Residu_t maxCardinality ()
 
static Residu_t minCardinality ()
 

Data Fields

const Element zero
 
const Element one
 
const Element mOne
 

Protected Attributes

Residu_t _p
 
Residu_t _pmone
 
Power_t_tab_value2rep
 
Residu_t_tab_rep2value
 
Power_t_tab_mul
 
Power_t_tab_div
 
Power_t_tab_neg
 
Power_t_tab_addone
 
Power_t_tab_subone
 
Power_t_tab_mone
 
Power_t_tab_pone
 
int * numRefs
 

Detailed Description

This class implement the standard arithmetic with Modulo Elements.

Member Typedef Documentation

◆ Storage_t

using Storage_t = int16_t

◆ Compute_t

using Compute_t = int16_t

◆ Residu_t

using Residu_t = uint16_t

◆ Element

using Element = Storage_t

◆ Element_ptr

using Element_ptr = Element*

◆ ConstElement

using ConstElement = const Element

◆ ConstElement_ptr

using ConstElement_ptr = const Element*

◆ Self_t

using Self_t = Modular<Log16>

◆ Parent_t

◆ Power_t

typedef int16_t Power_t

◆ Rep

typedef Power_t Rep

◆ RandIter

◆ NonZeroRandIter

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
size_rep 

Constructor & Destructor Documentation

◆ Modular() [1/2]

Modular ( Residu_t  p = 2)
inline

◆ Modular() [2/2]

Modular ( const Modular< Log16 > &  F)
inline

◆ ~Modular()

~Modular ( )
inline

Member Function Documentation

◆ operator==()

bool operator== ( const Modular< Log16 > &  BC) const
inline

◆ operator!=()

bool operator!= ( const Modular< Log16 > &  BC) const
inline

◆ operator=()

Modular< Log16 > & operator= ( const Modular< Log16 > &  F)
inline

◆ residu()

Modular< Log16 >::Residu_t residu ( ) const
inline

◆ size()

Residu_t size ( ) const
inline

◆ minElement()

Element minElement ( ) const
inline

◆ maxElement()

Element maxElement ( ) const
inline

◆ characteristic() [1/2]

Residu_t characteristic ( ) const
inline

◆ cardinality() [1/2]

Residu_t cardinality ( ) const
inline

◆ characteristic() [2/2]

T& characteristic ( T &  p) const
inline

◆ cardinality() [2/2]

T& cardinality ( T &  p) const
inline

◆ convert() [1/8]

int16_t& convert ( int16_t &  x,
const Rep  a 
) const
inline

◆ convert() [2/8]

uint16_t& convert ( uint16_t &  x,
const Rep  a 
) const
inline

◆ convert() [3/8]

uint32_t& convert ( uint32_t &  x,
const Rep  a 
) const
inline

◆ convert() [4/8]

int32_t& convert ( int32_t &  x,
const Rep  a 
) const
inline

◆ convert() [5/8]

uint64_t& convert ( uint64_t &  x,
const Rep  a 
) const
inline

◆ convert() [6/8]

int64_t& convert ( int64_t &  x,
const Rep  a 
) const
inline

◆ convert() [7/8]

double& convert ( double &  x,
const Rep  a 
) const
inline

◆ convert() [8/8]

Integer& convert ( Integer i,
const Rep  a 
) const
inline

◆ init() [1/10]

Modular< Log16 >::Rep & init ( Rep r) const
inline

◆ init() [2/10]

Modular< Log16 >::Rep & init ( Rep r,
const int64_t  a 
) const
inline

◆ init() [3/10]

Modular< Log16 >::Rep & init ( Rep a,
const int32_t  i 
) const
inline

◆ init() [4/10]

Modular< Log16 >::Rep & init ( Rep r,
const uint64_t  a 
) const
inline

◆ init() [5/10]

Modular< Log16 >::Rep & init ( Rep a,
const uint32_t  i 
) const
inline

◆ init() [6/10]

Modular< Log16 >::Rep & init ( Rep a,
const Integer i 
) const
inline

◆ init() [7/10]

Modular< Log16 >::Rep & init ( Rep a,
const double  i 
) const
inline

◆ init() [8/10]

Modular< Log16 >::Rep & init ( Rep a,
const float  i 
) const
inline

◆ init() [9/10]

Modular< Log16 >::Rep & init ( Rep a,
const int16_t  i 
) const
inline

◆ init() [10/10]

Modular< Log16 >::Rep & init ( Rep r,
const uint16_t  a 
) const
inline

◆ assign()

Modular< Log16 >::Rep & assign ( Rep r,
const Rep a 
) const
inline

◆ isZero()

bool isZero ( const Rep  a) const
inline

◆ isOne()

bool isOne ( const Rep  a) const
inline

◆ isUnit()

bool isUnit ( const Rep  a) const
inline

◆ isMOne()

bool isMOne ( const Rep  a) const
inline

◆ length()

size_t length ( const Rep  a) const
inline

◆ areEqual()

bool areEqual ( const Element a,
const Element b 
) const
inline

◆ mul()

Modular< Log16 >::Rep & mul ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ div()

Modular< Log16 >::Rep & div ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ add()

Modular< Log16 >::Rep & add ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ sub()

Modular< Log16 >::Rep & sub ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ neg()

Modular< Log16 >::Rep & neg ( Rep r,
const Rep a 
) const
inline

◆ inv()

Modular< Log16 >::Rep & inv ( Rep r,
const Rep a 
) const
inline

◆ mulin()

Modular< Log16 >::Rep & mulin ( Rep r,
const Rep a 
) const
inline

◆ divin()

Modular< Log16 >::Rep & divin ( Rep r,
const Rep a 
) const
inline

◆ addin()

Modular< Log16 >::Rep & addin ( Rep r,
const Rep a 
) const
inline

◆ subin()

Modular< Log16 >::Rep & subin ( Rep r,
const Rep a 
) const
inline

◆ negin()

Modular< Log16 >::Rep & negin ( Rep r) const
inline

◆ invin()

Modular< Log16 >::Rep & invin ( Rep r) const
inline

◆ axpy()

Modular< Log16 >::Rep & axpy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inline

◆ axpyin()

Modular< Log16 >::Rep & axpyin ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ axmy()

Modular< Log16 >::Rep & axmy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inline

◆ axmyin()

Modular< Log16 >::Rep & axmyin ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ maxpy()

Modular< Log16 >::Rep & maxpy ( Rep r,
const Rep a,
const Rep b,
const Rep c 
) const
inline

◆ maxpyin()

Modular< Log16 >::Rep & maxpyin ( Rep r,
const Rep a,
const Rep b 
) const
inline

◆ random()

Element& random ( Random &  g,
Element r 
) const
inline

◆ nonzerorandom()

Element& nonzerorandom ( Random &  g,
Element a 
) const
inline

◆ read() [1/2]

std::istream & read ( std::istream &  s)
inline

◆ write() [1/2]

std::ostream & write ( std::ostream &  s) const
inline

◆ read() [2/2]

std::istream & read ( std::istream &  s,
Rep a 
) const
inline

◆ write() [2/2]

std::ostream & write ( std::ostream &  s,
const Rep  a 
) const
inline

◆ maxCardinality()

static Residu_t maxCardinality ( )
inlinestatic

◆ minCardinality()

static Residu_t minCardinality ( )
inlinestatic

Field Documentation

◆ _p

Residu_t _p
protected

◆ _pmone

Residu_t _pmone
protected

◆ _tab_value2rep

Power_t* _tab_value2rep
protected

◆ _tab_rep2value

Residu_t* _tab_rep2value
protected

◆ _tab_mul

Power_t* _tab_mul
protected

◆ _tab_div

Power_t* _tab_div
protected

◆ _tab_neg

Power_t* _tab_neg
protected

◆ _tab_addone

Power_t* _tab_addone
protected

◆ _tab_subone

Power_t* _tab_subone
protected

◆ _tab_mone

Power_t* _tab_mone
protected

◆ _tab_pone

Power_t* _tab_pone
protected

◆ numRefs

int* numRefs
protected

◆ zero

const Element zero

◆ one

const Element one

◆ mOne

const Element mOne

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