This example shows how to instantiate a sequence of merit values computed using a specialized coordinate-uniform algorithm.
#include "latbuilder/CoordUniformFigureOfMerit.h"
#include "latcommon/ProductWeights.h"
#include "latbuilder/Kernel/PAlpha.h"
#include "latbuilder/Accumulator.h"
#include "latbuilder/Storage.h"
#include "latbuilder/MeritFilterList.h"
#include "latbuilder/MeritCombiner.h"
#include "latbuilder/MeritSeq/CoordUniformCBC.h"
#include "latbuilder/MeritSeq/CoordUniformInnerProd.h"
#include "latbuilder/GenSeq/CoprimeIntegers.h"
#include "latbuilder/GenSeq/Creator.h"
#include "latbuilder/TextStream.h"
#include <iostream>
#include <limits>
using TextStream::operator<<;
template <typename T, typename... ARGS>
std::unique_ptr<T> unique(ARGS&&... args)
{ return std::unique_ptr<T>(new T(std::forward<ARGS>(args)...)); }
{ filters.add(unique<MeritCombiner::SelectLevel>(size.
maxLevel())); }
template <LatType L, Compress C>
{
auto weights = unique<LatCommon::ProductWeights>();
weights->setDefaultWeight(0.7);
std::cout << "figure of merit: " << figure << std::endl;
auto cbc = MeritSeq::cbc<MeritSeq::CoordUniformInnerProd>(storage, figure);
setCombiner(filters, storage.sizeParam());
while (
cbc.baseLat().dimension() < dimension) {
std::cout << "CBC search for dimension: " << (baseDim + 1) << std::endl;
std::cout <<
" base lattice: " <<
cbc.baseLat() << std::endl;
std::cout <<
" base merit value: " <<
cbc.baseMerit() << std::endl;
auto meritSeq =
cbc.meritSeq(baseDim == 0 ? genSeq0 : genSeq);
auto filteredSeq = filters.apply(meritSeq);
auto best = std::min_element(filteredSeq.begin(), filteredSeq.end());
std::cout <<
"BEST LATTICE: " <<
cbc.baseLat() <<
" with merit value " << *best << std::endl;
}
}
int main()
{
return 0;
}