This examples shows how to use a component-by-component sequence of lattice definitions in a loop.
#include "latbuilder/SizeParam.h"
#include "latbuilder/LatSeq/CBC.h"
#include "latbuilder/GenSeq/CoprimeIntegers.h"
#include "latbuilder/TextStream.h"
#include <iostream>
using TextStream::operator<<;
template <typename SEQ>
typename SEQ::const_iterator findBest(const SEQ& seq)
{
std::cout << "searching for the best lattice in dimension: " << seq.baseLat().dimension() << std::endl;
std::cout << " possible choices: " << seq << std::endl;
return seq.begin();
}
int main()
{
while (baseLat.dimension() < dim) {
auto itBest = findBest(latSeq);
baseLat = *itBest;
std::cout << " selected lattice: " << baseLat << std::endl;
}
return 0;
}