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 &faxpy)
 Assignment operator. More...
 
Elementmulacc (const Element &a, const Element &x)
 Add a*x to y y += a*x. More...
 
Elementget (Element &y)
 Retrieve y. More...
 
FieldAXPYassign (const Element y)
 Assign method. More...
 

Protected Attributes

Field _field
 Field in which arithmetic is done Not sure why it must be mutable, but the compiler complains otherwise.
 
Element _y
 Field element for arithmetic.
 

Detailed Description

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

FieldAXPY object.

This class is used to wrap the operation y = y + a * x. It acts as an accumulator for y.

Through the use of template specialization, objects of this type can be used to speed up 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.

This object is constructed from the field object F and a field element a which it stores and thus can use several times. The use of an object instead of a static variable to store the element a makes this method thread-safe.

Parameters
FieldLinBox field

Constructor & Destructor Documentation

FieldAXPY ( const Field &  F)
inline

Constructor.

A faxpy object if constructed from a Field and a field element. Copies of this objects are stored in the faxpy object.

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)
inline

Retrieve y.

Performs the delayed modding out if necessary

FieldAXPY& assign ( const Element  y)
inline

Assign method.

Stores new field element for arithmetic.

Returns
reference to self
Parameters
yconstant reference to element a

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