Skip to content
Mahrud Sayrafi edited this page Mar 12, 2021 · 1 revision

title: Givaro interface permalink: wiki/Givaro_interface/ layout: wiki

Givaro GFqDom<> example:
(usage may possible if

NEED_POLYNOMIAL_REPRESENTATION(prime,exponent) 

is zero, otherwise Extension<> field has to be used, which has a slightly different constructor interface
Problem with NEED_POLYNOMIAL_REPRESENTATION: does not depend on FieldElementType ->not always correct; this issue is solved in LinBox, see LinBox::GivaroGfq )

GFqDom::Residu_t prime,exponent;

std::vector<GFqDom::Residu_t> irreducible_11_2;
irreducible_11_2.resize(3,1);
irreducible_11_2[0]=6; // 6
irreducible_11_2[1]=9; // + 9*x
irreducible_11_2[2]=1; // + 1*x^2

GFqDom gfqField( 11, 2, irreducible_11_2);

get characteristic:

  gfqField.characteristic();

get cardinality :

gfqField.cardinality();

get multiplicative group generator:


wrong way (does not work as expected) :

GFqDom::Element   gen = gfqField.generator();

correct way:

GFqDom::Element  gen;
gfqField.generator(gen);

'''get mod polynomial representation '''

gfqField.irreducible()

the mod polynomial is coded in a 'long int' (depends on GfqDom template parameter) : if the polynomial is = 'a + b*x + c*x^2 ' then the representation is a + b*char + c*char^2 + ....

construct a field element

It seems that in this field object (GFqDom) elements are represented via the generator exponent. therefore one would construct an element as follows:

el = GFqDom::Element(generatorExponent);

I didn't figure out what GFqDom::init(elOut,input) exactly does , but 'init()' does not work as i would expect.

The*' convert()*'-Function converts the element (generator exponent) back to a polynomial representation: if the polynomial is 'a+b*x+c*x^2+...' then the polynomial representation is a + b*char + c*char^2 +...)

additive neutral element

gfqField.zero

multiplicative neutral element

gfqField.one


Givaro::Extension

Usage example:

   int prime    = 11;
   
   GFqDom gfqBaseField( prime );
 
   Extension<>::Pol_t  pdomain( gfqBaseField );

   int modPolynomialDegree = 2;
   Extension<>::PolElement irreducible_11_2( modPolynomialDegree + 1 );
  
   irreducible_11_2 [ 0 ] = 6; // 6
   irreducible_11_2 [ 1 ] = 9; // + 9*11
   irreducible_11_2 [ 2 ] = 1; // + 11^2
       Extension<>     extensionField(pdomain, irreducible_11_2);

Clone this wiki locally