linbox
Public Member Functions | Static Protected Member Functions
Local2_32 Struct Reference

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

#include <local2_32.h>

Inherits UnparametricField< K >.

Public Types

Common Object Interface for a LinBox Field.

These methods and member types are required of all LinBox fields.

See FieldArchetype for detailed specifications.

typedef UnparametricRandIter< K > RandIter
 Type of random field element generators.

Public Member Functions

template<>
NTL::zz_p & inv (NTL::zz_p &x, const NTL::zz_p &y) const
template<>
NTL::zz_p & invin (NTL::zz_p &x) const
template<>
std::ostream & write (std::ostream &os) const
template<>
bool isZero (const NTL::zz_p &x) const
template<>
bool isOne (const NTL::zz_p &x) const
template<>
integercharacteristic (integer &c) const
template<>
integercardinality (integer &c) const
Field Object Basics.
Element & inv (Element &x, const Element &y) const
 c := characteristic of this field (zero or prime).
Element & invin (Element &x) const
 c := characteristic of this field (zero or prime).
std::ostream & write (std::ostream &os) const
 c := characteristic of this field (zero or prime).
std::ostream & write (std::ostream &os, const Element &p) const
 c := characteristic of this field (zero or prime).
bool isZero (const Element &x) const
 c := characteristic of this field (zero or prime).
bool isOne (const Element &x) const
 c := characteristic of this field (zero or prime).
long unsigned int characteristic (long unsigned int &p) const
 c := characteristic of this field (zero or prime).
long unsigned int characteristic () const
 c := characteristic of this field (zero or prime).
integercharacteristic (integer &c) const
 c := characteristic of this field (zero or prime).
long unsigned int cardinality () const
 c := characteristic of this field (zero or prime).
integercardinality (integer &c) const
 c := cardinality of this field (-1 if infinite).
template<typename Src >
Element & init (Element &x, const Src &s) const
 c := characteristic of this field (zero or prime).
std::istream & read (std::istream &is, Element &x) const
 c := characteristic of this field (zero or prime).
std::istream & read (std::istream &is) const
 c := characteristic of this field (zero or prime).
template<typename T >
T & convert (T &x, const Element &y) const
 c := characteristic of this field (zero or prime).
class RR.

Rational number field.

This field is provided as a convenience in a few places. Use with caution because expression swell.

This specialization allows the UnparametricField template class to be used to wrap NTL's RR class as a LinBox field.

template<>
NTL::RR & inv (NTL::RR &x, const NTL::RR &y) const
template<>
NTL::RR & invin (NTL::RR &x) const
template<>
std::ostream & write (std::ostream &os) const
template<>
bool isZero (const NTL::RR &x) const
template<>
bool isOne (const NTL::RR &x) const
template<>
NTL::ZZ_p & inv (NTL::ZZ_p &x, const NTL::ZZ_p &y) const
template<>
NTL::ZZ_p & invin (NTL::ZZ_p &x) const
template<>
std::ostream & write (std::ostream &os) const
template<>
bool isZero (const NTL::ZZ_p &x) const
template<>
bool isOne (const NTL::ZZ_p &x) const
template<>
integercharacteristic (integer &c) const
template<>
integercardinality (integer &c) const
Implementation-Specific Methods.

These methods are not required of all LinBox fields and are included only for the implementation of this field template.

const K & operator() (void) const
 Constant access operator.
K & operator() (void)
 Access operator.

Static Protected Member Functions

static Element & HGCD (Element &g, Element &s, const Element &a, const Element &b)
 Half GCD g = gcd (a, b).

Detailed Description

Fast arithmetic mod 2^32, including gcd.

Extend UnparametricField<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 Function Documentation

static Element& HGCD ( Element &  g,
Element &  s,
const Element &  a,
const Element &  b 
) [inline, static, protected]

Half GCD g = gcd (a, b).

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

NTL::zz_p & inv ( NTL::zz_p &  x,
const NTL::zz_p &  y 
) const [inherited]

x = 1 / y This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
yfield element.
NTL::RR & inv ( NTL::RR &  x,
const NTL::RR &  y 
) const [inherited]

x = 1 / y This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
yfield element.
NTL::ZZ_p & inv ( NTL::ZZ_p &  x,
const NTL::ZZ_p &  y 
) const [inherited]

x = 1 / y This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
yfield element.
NTL::zz_p & invin ( NTL::zz_p &  x) const [inherited]

x = 1 / x This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
NTL::RR & invin ( NTL::RR &  x) const [inherited]

x = 1 / x This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
NTL::ZZ_p & invin ( NTL::ZZ_p &  x) const [inherited]

x = 1 / x This function assumes both field elements have already been constructed and initialized.

Returns:
reference to x.
Parameters:
xfield element (reference returned).
std::ostream & write ( std::ostream &  os) const [inherited]
Returns:
output stream to which field is written.
Parameters:
osoutput stream to which field is written.
std::ostream & write ( std::ostream &  os) const [inherited]
Returns:
output stream to which field is written.
Parameters:
osoutput stream to which field is written.
std::ostream & write ( std::ostream &  os) const [inherited]
Returns:
output stream to which field is written.
Parameters:
osoutput stream to which field is written.
bool isZero ( const NTL::zz_p &  x) const [inherited]

Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.

Returns:
boolean true if equals zero, false if not.
Parameters:
xfield element.
bool isZero ( const NTL::RR &  x) const [inherited]

Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.

Returns:
boolean true if equals zero, false if not.
Parameters:
xfield element.
bool isZero ( const NTL::ZZ_p &  x) const [inherited]

Test if field element is equal to zero. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsZero function is called.

Returns:
boolean true if equals zero, false if not.
Parameters:
xfield element.
bool isOne ( const NTL::zz_p &  x) const [inherited]

Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.

Returns:
boolean true if equals one, false if not.
Parameters:
xfield element.
bool isOne ( const NTL::RR &  x) const [inherited]

Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.

Returns:
boolean true if equals one, false if not.
Parameters:
xfield element.
bool isOne ( const NTL::ZZ_p &  x) const [inherited]

Test if field element is equal to one. This function assumes the field element has already been constructed and initialized. In this specialization, NTL's IsOne function is called.

Returns:
boolean true if equals one, false if not.
Parameters:
xfield element.
integer & characteristic ( integer c) const [inherited]

Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.

Returns:
integer representing characteristic of the field.
integer & characteristic ( integer c) const [inherited]

Return integer representing characteristic of the field. Returns the modulus of the field, which should be prime.

Returns:
integer representing characteristic of the field.
integer & cardinality ( integer c) const [inherited]

Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.

Returns:
integer representing cardinality of the field
integer & cardinality ( integer c) const [inherited]

Return integer representing cardinality of the field. Returns the modulus of the field, which should be prime.

Returns:
integer representing cardinality of the field
const K& operator() ( void  ) const [inline, inherited]

Constant access operator.

Returns:
constant reference to field object
K& operator() ( void  ) [inline, inherited]

Access operator.

Returns:
reference to field object

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