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

This example shows how to instantiate a random sequence of lattice definitions.

This example shows how to instantiate a random sequence of lattice definitions.

// 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 "latbuilder/SizeParam.h"
#include "latbuilder/LatSeq/Combiner.h"
#include "latbuilder/GenSeq/GeneratingValues.h"
#include "latbuilder/GenSeq/VectorCreator.h"
#include "latbuilder/Traversal.h"
#include "latbuilder/LFSR258.h"
#include "latbuilder/TextStream.h"
#include "Path.h"
#include <iostream>
using namespace LatBuilder;
using TextStream::operator<<;
template <LatticeType LA>
void test(typename LatticeTraits<LA>::Modulus modulus){
Dimension dim = 3;
size_t r = 4; // 4 random samples
auto genSeqs = GenSeq::VectorCreator<Coprime>::create(size, dim,r);
// consider only 1 for 1st coordinate
genSeqs[0] = GenSeq::Creator<Coprime>::create(size0);
auto latSeq = LatSeq::combine<Zip>(size, genSeqs);
std::cout << latSeq << std::endl;
}
int main()
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
test<LatticeType::ORDINARY>(31);
test<LatticeType::POLYNOMIAL>(PolynomialFromInt(31));
return 0;
}
This file contains a global variable PATH_TO_LATNETBUILDER_DIR which should always equal the path to ...
Indexed sequence of generating values: -For ordinary lattices: integers coprime with a specified modu...
Definition GeneratingValues.h:48
Lattice size parameter.
Definition SizeParam.h:30
Combiner< LR, ET, GENSEQ, POLICY > combine(SizeParam< LR, ET > size, std::vector< GENSEQ > genSeqs)
Creates a lattice sequence based on a combination of sequences of generator values.
Definition Combiner.h:102
LatBuilder namespace.
Definition libtut_lat.dox:17
Polynomial PolynomialFromInt(uInteger x)
convert Integer to polynomial
size_t Dimension
Scalar integer type for dimension.
Definition Types.h:53
static result_type create(const SizeParam< LR, L > &sizeParam, ARGS &&... t)
Creates a new sequence object.
Definition Creator.h:43
static result_type create(const SizeParam< LR, L > &sizeParam, Dimension dimension, ARGS &&... t)
Creates a new sequence object.
Definition VectorCreator.h:84
Lattice traits.
Definition Types.h:92