This example shows how to enumerate integers (respectively polynomials) in the cyclic group of integers modulo \(n\) (respectively polynomials modulo \(P\)), in the natural group order, that is, using the group generator.
This example shows how to enumerate integers (respectively polynomials) in the cyclic group of integers modulo \(n\) (respectively polynomials modulo \(P\)), in the natural group order, that is, using the group generator.
#include "latbuilder/GenSeq/CyclicGroup.h"
#include "latbuilder/TextStream.h"
#include <iostream>
using TextStream::operator<<;
void displayIntSeq(int base, int power)
{
std::cout << "lattice modulus: " << base << "^" << power << std::endl;
std::cout << " whole sequence: " << WholeIntSeq(base, power) << std::endl;
std::cout << " half sequence: " << HalfIntSeq(base, power) << std::endl;
}
{
std::cout << "polynomial lattice modulus: " << base << "^" << power << std::endl;
std::cout << " whole sequence: " << WholePolySeq(base, power) << std::endl;
}
int main()
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
displayIntSeq(7, 1);
displayIntSeq(2, 3);
displayIntSeq(3, 2);
return 0;
}
This file contains a global variable PATH_TO_LATNETBUILDER_DIR which should always equal the path to ...
Cyclic group.
Definition CyclicGroup.h:118
LatBuilder namespace.
Definition libtut_lat.dox:17
Polynomial PolynomialFromInt(uInteger x)
convert Integer to polynomial
NTL::polynomial Polynomial
polynomial over Z/2Z type. This is just a wrapper over NTL::GF2X. See ntlwrap.h.
Definition Types.h:56