linbox
Public Types | Public Member Functions | Protected Attributes
FieldAXPY< Field > Class Template Reference

FieldAXPY object. More...

#include <field-axpy.h>

Public Types

typedef Field::Element Element
 Definition of element type.
 

Public Member Functions

 FieldAXPY (const Field &F)
 Constructor. More...
 
 FieldAXPY (const FieldAXPY< Field > &faxpy)
 Copy constructor. More...
 
FieldAXPY< Field > & operator= (const FieldAXPY< Field > &faxpy)
 Assignment operator. More...
 
Elementmulacc (const Element &a, const Element &x)
 Add a*x to y y += a*x. More...
 
Elementget (Element &y) const
 Retrieve y. More...
 
void reset ()
 reset value to zero.
 

Protected Attributes

const Field * _field
 Field in which arithmetic is done.
 
Abnormal _y
 Accumulator, unnormalized field element.
 

Detailed Description

template<class Field>
class LinBox::FieldAXPY< Field >

FieldAXPY object.

A fieldAXPY is an accumulator, allowing to add a number of field elements or products in an unnormalized state, delaying modular reduction as long as possible. This class containse a value y and wraps the operations y = y + a * x and y = y + a.

This default instance does no optimization, no delayed modular reduction. Through the use of template specialization, objects of this type can be used to speed up operations such as vector dot product operations. In particular, for finite fields, dividing by the modulus and taking the remainder is expensive. In many cases, this can be postponed until the end of the dot product operation, thus vastly improving performance.

FieldAXPY<Fld> is an assignable type. It is constructed from a field instance. The methods are mulacc(), accumulate(), operator=(), reset(), get(), and field(). Of a const instance you can access get() and field(). [Note: get() may renormalize the value, but it remains constant as a field element.]

Parameters
FieldLinBox field

Constructor & Destructor Documentation

FieldAXPY ( const Field &  F)
inline

Constructor.

Parameters
Ffield F in which arithmetic is done
FieldAXPY ( const FieldAXPY< Field > &  faxpy)
inline

Copy constructor.

Parameters
faxpy

Member Function Documentation

FieldAXPY<Field>& operator= ( const FieldAXPY< Field > &  faxpy)
inline

Assignment operator.

Parameters
faxpy
Element& mulacc ( const Element a,
const Element x 
)
inline

Add a*x to y y += a*x.

Parameters
aconstant reference to element a
xconstant reference to element x
Element& get ( Element y) const
inline

Retrieve y.

Performs the delayed modding out if necessary


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