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/GeneratingValues.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: " << std::endl << seq << std::endl;
return seq.begin();
}
template<LatticeType LA>
while (baseLat.dimension() < dim) {
auto itBest = findBest(latSeq);
baseLat = *itBest;
std::cout << "selected lattice: " << std::endl << baseLat << std::endl;
std::cout << std::endl;
}
}
int main()
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
CBCsearch<LatticeType::ORDINARY>(8);
std::cout << std::endl;
return 0;
}