linbox
Local2_32 Struct Reference

Fast arithmetic mod 2^32, including gcd. More...

#include <local2_32.h>

+ Inheritance diagram for Local2_32:

Public Types

enum  Exponent { _min =0 , _max =32 }
 
typedef Givaro::ZRing< uint32_t >::Element Element
 

Public Member Functions

 Local2_32 (int p=2, int exp=32)
 
Elementgcd (Element &c, const Element &a, const Element &b) const
 
Elementgcdin (Element &b, const Element &a) const
 
Exponentgcdin (Exponent &k, const Element &b) const
 
bool isUnit (const Element &a) const
 
bool isUnit (const Exponent &a) const
 
bool isZero (const Element &a) const
 
bool isZero (const Exponent &a) const
 
Elementmulin (Element &a, const Exponent &k) const
 
Elementmulin (Element &a, const Element &b) const
 
Elementaxpyin (Element &r, const Element &x, const Element &y) const
 
Elementdivin (Element &a, const Exponent &k) const
 
Elementinv (Element &a, const Element &b) const
 

Static Public Member Functions

static integer maxCardinality ()
 

Protected Member Functions

Elementxgcd (Element &d, Element &s, Element &t, const Element &a, const Element &b) const
 
ElementHGCD (Element &g, Element &s, const Element &a, const Element &b) const
 Half GCD g = gcd (a, b).
 

Detailed Description

Fast arithmetic mod 2^32, including gcd.

Extend Givaro::ZRing<uint32_t> which is a representation of Z_2^32. It is especially fast because it uses hardware arithmetic directly. This ring is a Local Principal Ideal Ring.

These needed PIR functions are added: gcdin(), isUnit(), also inv() is modified to work correctly. The type Exponent is added: more effective rep of the powers of 2, which are important because gcds are powers of 2). This entails some new versions of divin(), mulin(), isUnit().

Those are the function needed for the LocalSmith algorithm. Further appropriate PIR functions may be added later.

Examples
examples/smith.C.

Member Typedef Documentation

◆ Element

typedef Givaro::ZRing<uint32_t>::Element Element

Member Enumeration Documentation

◆ Exponent

enum Exponent
Enumerator
_min 
_max 

Constructor & Destructor Documentation

◆ Local2_32()

Local2_32 ( int p = 2,
int exp = 32 )
inline

Member Function Documentation

◆ gcd()

Element & gcd ( Element & c,
const Element & a,
const Element & b ) const
inline

◆ gcdin() [1/2]

Element & gcdin ( Element & b,
const Element & a ) const
inline

◆ gcdin() [2/2]

Exponent & gcdin ( Exponent & k,
const Element & b ) const
inline

◆ isUnit() [1/2]

bool isUnit ( const Element & a) const
inline

◆ isUnit() [2/2]

bool isUnit ( const Exponent & a) const
inline

◆ isZero() [1/2]

bool isZero ( const Element & a) const
inline

◆ isZero() [2/2]

bool isZero ( const Exponent & a) const
inline

◆ mulin() [1/2]

Element & mulin ( Element & a,
const Exponent & k ) const
inline

◆ mulin() [2/2]

Element & mulin ( Element & a,
const Element & b ) const
inline

◆ axpyin()

Element & axpyin ( Element & r,
const Element & x,
const Element & y ) const
inline

◆ divin()

Element & divin ( Element & a,
const Exponent & k ) const
inline

◆ inv()

Element & inv ( Element & a,
const Element & b ) const
inline

◆ maxCardinality()

static integer maxCardinality ( )
inlinestatic

◆ xgcd()

Element & xgcd ( Element & d,
Element & s,
Element & t,
const Element & a,
const Element & b ) const
inlineprotected

◆ HGCD()

Element & HGCD ( Element & g,
Element & s,
const Element & a,
const Element & b ) const
inlineprotected

Half GCD g = gcd (a, b).

exists t, such that: s * a + t * b = g. return g.


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