LatNet Builder Manual 2.1.3-6
Software Package for Constructing Highly Uniform Point Sets
Loading...
Searching...
No Matches
tutorial/NetSearchRandom.cc

This example shows how to instantiate an RandomSearch task to search for the best merit among a random sample of nets.

This example shows how to instantiate an RandomSearch task to search for the best merit among a random sample of nets.

// This file is part of LatNet Builder.
//
// Copyright (C) 2012-2021 The LatNet Builder author's, supervised by Pierre L'Ecuyer, Universite de Montreal.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <iostream>
#include <memory>
#include "netbuilder/FigureOfMerit/CoordUniformFigureOfMerit.h"
#include "netbuilder/Task/RandomSearch.h"
#include "latticetester/ProductWeights.h"
#include "Path.h"
#include "latbuilder/Kernel/PAlphaTilde.h"
using namespace NetBuilder;
using namespace NetBuilder::FigureOfMerit;
using namespace NetBuilder::Task;
int main(int argc, char** argv)
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
unsigned int alpha = 2;
auto kernel = LatBuilder::Kernel::PAlphaTilde(alpha);
auto weights = std::make_unique<LatticeTester::ProductWeights>(.7);
auto figure = std::make_unique<CoordUniformFigureOfMerit<LatBuilder::Kernel::PAlphaTilde, EmbeddingType::UNILEVEL>>(std::move(weights), kernel);
SizeParameter size(10);
Dimension s = 5;
auto task = std::make_unique<RandomSearch<NetConstruction::SOBOL, EmbeddingType::UNILEVEL>>(s, size, std::move(figure), 100);
std::cout << task->format();
task->execute();
std::cout << "Best net:" << std::endl;
std::cout << task->bestNet().format() << std::endl;
std::cout << "Merit value: " << task->bestMeritValue() << std::endl;
}
This file contains the base classes for digital nets in base 2.
This file contains a global variable PATH_TO_LATNETBUILDER_DIR which should always equal the path to ...
Definition PAlphaTilde.h:26
Basic type definitions of NetBuilder.
Figures of merit that can be computed by NetBuilder.
Definition libtut_net.dox:144
Standard tasks that can be performed by LatBuilder.
Definition libtut_net.dox:202
NetBuilder namespace.
Definition libtut_net.dox:17
size_t Dimension
Scalar integer type for dimension.
Definition Types.h:52
Digital net construction traits.
Definition NetConstructionTraits.h:77