LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
Figures of merit

The FigureOfMerit abstract class represents the various figures of merit supported by NetBuilder for digital nets.

This class works with another abstract class, FigureOfMeritEvaluator, which can evaluate figures of merit for digital nets.

This scheme is used in the following code example:

First, a figure of merit is created. It corresponds to the t-value:

auto figure = std::make_unique<TValue<EmbeddingType::UNILEVEL>>();

Then, the evaluator associated to this figure of merit is instantiated:

auto evaluator = figure->evaluator();

We create a digital net (Sobol' construction) in dimension 10 with \(2^{15}\) points, using the direction number given by Joe and Kuo in [14] :

auto net = createJoeKuoSobolNet(10, 15);

We finally compute the t-value of the net using the evaluator:

std::cout << "Merit value: " << (*evaluator)(net) << std::endl << std::endl;

Most figures of merit can be evaluated in a CBC-way: this corresponds to the CBCFigureOfMerit abstract class which derives from FigureOfMerit. Its evaluator (of type CBCFigureOfMeritEvaluator) has additional methods to compute the figure of merit in a CBC way.

First, a figure of merit is created. It corresponds to the \(\mathcal P_2\) discrepancy:

unsigned int alpha = 2;
auto kernel = LatBuilder::Kernel::PAlphaPLR(alpha);
auto weights = std::make_unique<LatticeTester::ProductWeights>(.7);
auto figure = std::make_unique<CoordUniformFigureOfMerit<LatBuilder::Kernel::PAlphaPLR, EmbeddingType::UNILEVEL>>(std::move(weights), kernel);

Then, the evaluator associated to this figure of merit is instantiated:

auto evaluator = figure->evaluator();

We first compute the merit value for all coordinates at once:

std::cout << "Standard way:" << std::endl;
std::cout << "Merit value: " << (*evaluator)(net) << std::endl;

We can reproduce this computation using the CBC-way:

std::cout << "CBC-way:" << std::endl;
MeritValue merit = 0; // start from a merit equal to zero
for(Dimension coord = 0; coord < net.dimension(); ++coord) // for each coordinate
{
evaluator->prepareForNextDimension(); // prepare the evaluator for the next coordinate
std::cout << "Begin coordinate: " << coord + 1 << "/" << net.dimension() << std::endl;
merit = evaluator->operator()(net, coord, merit); // evaluate the partial merit value
std::cout << "Partial merit value: " << merit << std::endl;
evaluator->lastNetWasBest(); // tell the evaluator that the only net evaluated was best and shoud be kept for the next dimension
}
std::cout << "Merit value: " << (*evaluator)(net) << std::endl;

The complete example can be found in tutorial/NetFigures.cc.