linbox
|
#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... | |
Element & | mulacc (const Element &a, const Element &x) |
Add a*x to y y += a*x. More... | |
Element & | get (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. | |
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.]
|
inline |
Constructor.
F | field F in which arithmetic is done |
Assignment operator.
faxpy |
Add a*x to y y += a*x.
a | constant reference to element a |
x | constant reference to element x |