Lattice Builder Manual Software Package for Constructing Rank-1 Lattices
tutorial/GenSeqCyclicGroup.cc

This example shows how to enumerate integers in the cyclic group of integers modulo $$n$$, in the natural group order, that is, using the group generator.

//
// This file is part of Lattice Builder.
//
// Lattice Builder is free software: you can redistribute it and/or modify
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Lattice Builder is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Lattice Builder. If not, see <http://www.gnu.org/licenses/>.
#include "latbuilder/GenSeq/CyclicGroup.h"
#include "latbuilder/TextStream.h"
#include <iostream>
using namespace LatBuilder;
using TextStream::operator<<;
void displaySeq(int base, int power)
{
std::cout << "lattice size: " << base << "^" << power << std::endl;
std::cout << " whole sequence: " << WholeSeq(base, power) << std::endl;
std::cout << " half sequence: " << HalfSeq(base, power) << std::endl;
}
int main()
{
displaySeq(7, 1);
displaySeq(2, 3);
displaySeq(3, 2);
return 0;
}