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

This example shows how to instantiate lattice definitions.

This example shows how to instantiate 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/LatDef.h"
#include "latbuilder/SizeParam.h"
#include "latbuilder/TextStream.h"
#include "Path.h"
#include <iostream>
using namespace LatBuilder;
using TextStream::operator<<;
template <LatticeType LA, EmbeddingType L>
void printLatDef(const LatDef<LA, L>& def)
{
std::cout << "dimension: " << def.dimension() << std::endl;
std::cout << "size parameter: " << def.sizeParam() << std::endl;
std::cout << "generating vector: " << def.gen() << std::endl;
std::cout << "definition: " << std::endl << def << std::endl;
}
int main()
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
std::cout << "ordinary - simple lattice:" << std::endl;
printLatDef(ordinary);
std::cout << "ordinary - embedded lattice:" << std::endl;
printLatDef(embedded);
Polynomial P = PolynomialFromInt(13); // P = 1 + z^2 + z^3
auto pordinary = createLatDef(
);
std::cout << "polynomial - simple lattice:" << std::endl;
printLatDef(pordinary);
auto pembedded = createLatDef(
);
std::cout << "polynomial - embedded lattice:" << std::endl;
printLatDef(pembedded);
return 0;
}
This file contains a global variable PATH_TO_LATNETBUILDER_DIR which should always equal the path to ...
Definition of a rank-1 lattice.
Definition LatDef.h:40
SizeParam< LR, ET > & sizeParam()
Returns the size parameter of the lattice.
Definition LatDef.h:65
Dimension dimension() const
Returns the dimension of the lattice.
Definition LatDef.h:85
GeneratingVector & gen()
Returns the generating vector of the lattice.
Definition LatDef.h:75
Lattice size parameter.
Definition SizeParam.h:30
LatBuilder namespace.
Definition libtut_lat.dox:17
Polynomial PolynomialFromInt(uInteger x)
convert Integer to polynomial
LatDef< LR, ET > createLatDef(SizeParam< LR, ET > sizeParam=SizeParam< LR, ET >(), typename LatDef< LR, ET >::GeneratingVector gen=typename LatDef< LR, ET >::GeneratingVector())
Returns a lattice definition instance with the proper type of size parameter.
Definition LatDef.h:144
NTL::polynomial Polynomial
polynomial over Z/2Z type. This is just a wrapper over NTL::GF2X. See ntlwrap.h.
Definition Types.h:56