Lattice Tester Guide
1.0-9
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
|
Sets standard typedef
’s for the types that can be used in LatticeTester.
More...
#include <latticetester/Types.h>
Sets standard typedef
’s for the types that can be used in LatticeTester.
Although it is not directly used anymore, it is provided to external users as a way to easily use supported types, as well as for historical reasons. The types depend on how NTL_TYPES_CODE
is defined: types used can be primitives, like std::int64_t
, double
, etc., or large number types defined in the NTL dependency. The NTL_TYPES_CODE
variable can be defined when compiling (for example, with -DNTL_TYPES_CODE=x
passed to a compiler like g++) or in the executables.
Originally this file was created as a way to define the types used by the program by passing a definition of NTL_TYPES_CODE
to the compiler. This trick was used in the first version of this software in Modula 2 to switch from hardware supported types to software implemented types to have access to a much needed arbitrary precision in some calculations. With modern programming languages, such as C++, we have access to tools, such as overloading and templates, that makes it much easier to avoid having to recompile every time we want to change types. Types are now declared when intanciating a class rather than globally with a definition passed to a compiler, making it possible to create an executable that supports any combination of types (virtually as we only test and support for the types combinations of this file as of now).
Some of the typedef
s define the same type and this is intentional. It comes from the old functionnalities of the program. There are different type prefixes: M
, B
, N
and R
. Originally, these prefixes and their respective typedef
s where used in different modules to do different kind of calculations.
M
stands for modulo and served as a type for general computations in the lattice (as most of the calculations on integer are made modulo m). Note that for an unknown reason the actual modulo types are not used anymore. These types must be some kind of integer types because we build the lattices in \(\mathbb{Z}_m\).B
stands for basis. These types where used in basis representation, calculation and reductions. These types must be an integer type for the same reason as M
N
stands for norm. These types are used when there is a norm or a scalar product to compute. Because these kind of calculations can, in some cases, give floating point numbers (especially in the case of a norm) these types must be floating point numers.R
stands for reduced. These types where used in calculations requiring floating point numbers when reducing a basis (such as Cholesky decomposition) as well as figures of merit. These types must be floating point numbers.In the current version of the software, the types where replaced by template typenames (that feel slightly less criptic to me) as follows:
MScal -> Int
MVect -> IntVec
MMat -> IntMat
M*P -> nothing (never used)
BScal -> BasInt
BVect -> BasIntVec
BMat -> BasIntMat
NScal -> Dbl
NVect -> DblVec
NMat -> DblMat
RScal -> RedDbl
RVect -> RedDblVec
RMat -> RedDblMat
The typedefs are defined as follow for the different values of the NTL_TYPES_CODE constant.