There are three main ways to use the openf4 library (from the simplest to the most involved):
-
In Sage (not yet available):
-
R.<x0,x1,x2,x3,x4,x5> = Zmod(2)[]
-
I = sage.rings.ideal.Cyclic(R,6)
-
I.groebner_basis('openf4')
-
As a C++ library:
-
Include the library header: libopenf4.h.
-
Link with the library during the compilation: -lopenf4
-
Use the function groebnerBasisGF2F4(int nbVariable, std::vector<std::string> variableName, std::vector<std::string> polynomialList, int nbThread, int verbose);
-
Look at the example tutorial-gf2-method2.cpp into the section example.
-
As a template library:
-
Include the header openf4.h.
-
Define the element type:
-
typedef ElementGF2 eltType;
-
Configure the class monomial with the number of variables and an initial degree for the monomial precomputation.
-
Create an ideal with a vector of polynomials and others informations: F4::Ideal::Ideal(std::vector<Polynomial<Element>> & polynomialArray, int nbVariable, int capacity, int degree);
-
Call the method f4: F4::Ideal::f4();
-
Compile with:
-
-std=c++11 to enable c++11 support
-
-DNDEBUG to disable assertion
-
-fopenmp to use parallelisation
-
-march=native to use vectorisation (if your system support SSE instructions).
-
-03 -funroll-loops -ftree-vectorize (for fast)
-
-Wall -Wno-strict-overflow to enable useful warning.
-
Link with:
-
-fopenmp to use parallelisation
-
Look at the example tutorial-gf2-method3.cpp into the section example.