Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

UnparametricField Class Template Reference

#include <unparametric.h>

Inheritance diagram for UnparametricField:

FieldInterface

template<class K>
class LinBox::UnparametricField< K >


Public Types

Common Object Interface for a LinBox Field.
typedef K Element
typedef UnparametricRandIter<
K
RandIter
 Type of random field element generators.


Public Member Functions

Field Object Basics.
 UnparametricField (integer q=0, size_t e=1)
 UnparametricField (const UnparametricField &F)
 construct this field as copy of F.

 ~UnparametricField ()
UnparametricFieldoperator= (const UnparametricField &F)
Data Object Management.
first argument is set and the value is also returned.

Elementinit (Element &x, const integer &y=0) const
 x := y. Caution: it is via cast to long. Good candidate for specialization.

integerconvert (integer &x, const Element &y) const
 x := y. Caution: it is via cast to long. Good candidate for specialization.

double & convert (double &x, const Element &y) const
 x := y. Caution: it is via cast to long. Good candidate for specialization. --dpritcha

Elementassign (Element &x, const Element &y) const
integercardinality (integer &c) const
 c := cardinality of this field (-1 if infinite).

integercharacteristic (integer &c) const
 c := characteristic of this field (zero or prime).

Comparison Predicates
bool areEqual (const Element &x, const Element &y) const
 x == y

bool isZero (const Element &x) const
 x == 0

bool isOne (const Element &x) const
 x == 1

Arithmetic Operations
The first argument is set and is also the return value.

Elementadd (Element &x, const Element &y, const Element &z) const
 x := y + z

Elementsub (Element &x, const Element &y, const Element &z) const
 x := y - z

Elementmul (Element &x, const Element &y, const Element &z) const
 x := y*z

Elementdiv (Element &x, const Element &y, const Element &z) const
 x := y/z

Elementneg (Element &x, const Element &y) const
 x := -y

Elementinv (Element &x, const Element &y) const
 x := 1/y

Elementaxpy (Element &z, const Element &a, const Element &x, const Element &y) const
 z := a*x + y

Inplace Arithmetic Operations
The first argument is modified and the result is the return value.

Elementaddin (Element &x, const Element &y) const
 x := x + y

Elementsubin (Element &x, const Element &y) const
 x := x - y

Elementmulin (Element &x, const Element &y) const
 x := x*y

Elementdivin (Element &x, const Element &y) const
 x := x/y

Elementnegin (Element &x) const
 x := -x

Elementinvin (Element &x) const
 x := 1/x

Elementaxpyin (Element &y, const Element &a, const Element &x) const
 y := a*x + y

Input/Output Operations
std::ostream & write (std::ostream &os) const
std::istream & read (std::istream &is) const
std::ostream & write (std::ostream &os, const Element &x) const
std::istream & read (std::istream &is, Element &x) const
Implementation-Specific Methods.
These methods are not required of all LinBox fields and are included only for the implementation of this field template.

 UnparametricField (const K &A)
 Default constructor.

const Koperator() (void) const
Koperator() (void)

Protected Attributes

integer _p
integer _card

Member Typedef Documentation

typedef K Element
 

The field's element type. Type K must provide a default constructor, a copy constructor, a destructor, and an assignment operator.

Reimplemented in GivaroRational, Local2_32, and PIR_ntl_ZZ_p.

typedef UnparametricRandIter<K> RandIter
 

Type of random field element generators.


Constructor & Destructor Documentation

UnparametricField integer  q = 0,
size_t  e = 1
[inline]
 

Builds this field to have characteristic q and cardinality qe. This constructor must be defined in a specialization.

UnparametricField const UnparametricField< K > &  F  )  [inline]
 

construct this field as copy of F.

~UnparametricField  )  [inline]
 

XML constructor Takes in an XML reader and attempts to convert the XML representation over to a valid field. As this class is mostly a wrapper for a particular field type, the XML does little more than encode the cardinality of this field, and perhaps the characteristic

UnparametricField const K A  )  [inline]
 

Default constructor.

Constructor from field object.

Parameters:
A unparameterized field object


Member Function Documentation

UnparametricField& operator= const UnparametricField< K > &  F  )  [inline]
 

Element& init Element x,
const integer y = 0
const [inline]
 

x := y. Caution: it is via cast to long. Good candidate for specialization.

Reimplemented in GivaroRational.

integer& convert integer x,
const Element y
const [inline]
 

x := y. Caution: it is via cast to long. Good candidate for specialization.

double& convert double &  x,
const Element y
const [inline]
 

x := y. Caution: it is via cast to long. Good candidate for specialization. --dpritcha

Element& assign Element x,
const Element y
const [inline]
 

integer& cardinality integer c  )  const [inline]
 

c := cardinality of this field (-1 if infinite).

integer& characteristic integer c  )  const [inline]
 

c := characteristic of this field (zero or prime).

bool areEqual const Element x,
const Element y
const [inline]
 

x == y

bool isZero const Element x  )  const [inline]
 

x == 0

bool isOne const Element x  )  const [inline]
 

x == 1

Element& add Element x,
const Element y,
const Element z
const [inline]
 

x := y + z

Element& sub Element x,
const Element y,
const Element z
const [inline]
 

x := y - z

Element& mul Element x,
const Element y,
const Element z
const [inline]
 

x := y*z

Element& div Element x,
const Element y,
const Element z
const [inline]
 

x := y/z

Reimplemented in NTL_PID_zz_p.

Element& neg Element x,
const Element y
const [inline]
 

x := -y

Element& inv Element x,
const Element y
const [inline]
 

x := 1/y

Element& axpy Element z,
const Element a,
const Element x,
const Element y
const [inline]
 

z := a*x + y

Element& addin Element x,
const Element y
const [inline]
 

x := x + y

Element& subin Element x,
const Element y
const [inline]
 

x := x - y

Element& mulin Element x,
const Element y
const [inline]
 

x := x*y

Element& divin Element x,
const Element y
const [inline]
 

x := x/y

Reimplemented in NTL_PID_zz_p.

Element& negin Element x  )  const [inline]
 

x := -x

Element& invin Element x  )  const [inline]
 

x := 1/x

Element& axpyin Element y,
const Element a,
const Element x
const [inline]
 

y := a*x + y

std::ostream & write std::ostream &  os  )  const [inline]
 

Print field.

Returns:
output stream to which field is written.
Parameters:
os output stream to which field is written.

std::istream& read std::istream &  is  )  const [inline]
 

Read field.

Returns:
input stream from which field is read.
Parameters:
is input stream from which field is read.

std::ostream& write std::ostream &  os,
const Element x
const [inline]
 

Print field element.

Returns:
output stream to which field element is written.
Parameters:
os output stream to which field element is written.
x field element.

std::istream& read std::istream &  is,
Element x
const [inline]
 

Read field element.

Returns:
input stream from which field element is read.
Parameters:
is input stream from which field element is read.
x field element.

const K& operator() void   )  const [inline]
 

Constant access operator.

Returns:
constant reference to field object

K& operator() void   )  [inline]
 

Access operator.

Returns:
reference to field object


Field Documentation

integer _p [protected]
 

integer _card [protected]
 


Generated on Fri Jul 8 10:29:54 2005 for linbox by doxygen 1.3.7