FAAST  0.2.1
FAAST::UndefinedFieldException Class Reference

The element has no parent field specified. More...

Inherits FAAST::FAASTException.

Detailed Description

The element has no parent field specified.

You are trying to make a field-dependent operation on an element for which no parent field has been specified yet.

A typical mistake leading to this exception is trying to assign or sum a scalar to a FieldElement before having made the FieldElement member of any Field.

FieldElement<T> x;
x += 1;

In this example, after the creation x is 0, but it does not belong to any field. You can add x to any element of any field, or even to another generic 0 element, but you cannot add x to a scalar since the library wouldn't know modulo which integer to reduce the scalar.

A correct example, assuming K has been defined to be a field, would be

FieldElement<T> x = K.zero();
x += 1;

or, equivalently,

FieldElement<T> x;
x += K.scalar(1);