Lattice Tester Guide
1.0-9
Software Package For Testing The Uniformity Of Integral Lattices In The Real Space
|
Classes which inherit from this base class are used in implementing bounds on the length of the shortest nonzero vector in a lattice. More...
#include <latticetester/Normalizer.h>
Inherited by LatticeTester::NormaBestBound< RedDbl >, LatticeTester::NormaBestLat< RedDbl >, LatticeTester::NormaLaminated< RedDbl >, LatticeTester::NormaMinkL1< RedDbl >, LatticeTester::NormaMinkowski< RedDbl >, LatticeTester::NormaPalpha< Int, RedDbl >, and LatticeTester::NormaRogers< RedDbl >.
Public Member Functions | |
Normalizer (RedDbl &logDensity, int t, std::string Name, NormType norm=L2NORM, double beta=1) | |
Complete constructor for a Normalizer . More... | |
Normalizer (int t, std::string Name, NormType norm=L2NORM, double beta=1) | |
Constructor that does not take the density as an argument. More... | |
virtual | ~Normalizer () |
Destructor. More... | |
virtual void | init (RedDbl &logDensity, double beta) |
This is a method that will initialize the bounds this normalizer can return. More... | |
std::string | ToString () const |
Returns a string that describes this object. More... | |
NormType | getNorm () const |
Returns the norm associated with this object. More... | |
void | setLogDensity (RedDbl logDensity) |
Sets the log-density associated with this object to logDensity . More... | |
RedDbl | getLogDensity () const |
Returns the logDensity associated with this object. More... | |
void | setNorm (NormType norm) |
Sets the norm associated with this object to norm . More... | |
int | getDim () const |
Returns the maximal dimension for this object. More... | |
double | getPreComputedBound (int j) const |
Returns the bound for dimension j as computed in Normalizer::init(). More... | |
virtual RedDbl | getBound (int j) const |
Calculates and returns the bound on the length of the shortest nonzero vector in dimension j . More... | |
virtual double | getGamma (int j) const |
Returns the value of a lattice constant \(\gamma\) in dimension \(j\). More... | |
Static Public Attributes | |
static const int | MAX_DIM = 48 |
The maximum dimension of the lattices for which this class can give an upper bound. More... | |
Protected Attributes | |
std::string | m_name |
Name of the normalizer. More... | |
NormType | m_norm |
Norm associated with this object. More... | |
RedDbl | m_logDensity |
log of the density, ie log of the number of points of the lattice per unit of volume. More... | |
int | m_maxDim |
Only elements 1 to m_maxDim (inclusive) of m_bounds bellow will be pre-computed. More... | |
double | m_beta |
Beta factor used to give more or less importance to some of the dimensions. More... | |
double * | m_bounds |
Contains the bounds on the length of the shortest nonzero vector in the lattice in each dimension. More... | |
Classes which inherit from this base class are used in implementing bounds on the length of the shortest nonzero vector in a lattice.
Given a lattice in dimension \(t\), it is possible to center non-interlapping spheres of radius \( d_t \) where \( d_t \) is the lenght of the shortest vector in the lattice. It turns out that the proportion of the space covered by these spheres can be used as a figure of merit for both the dual and the primal lattice. Suppose \( V \) contains the basis of the lattice in its lines. Then the density of the lattice is defined by \( \frac{1}{|\text{det}(V)|} \). It is the number of points that the (not rescalled) lattice will have in \([0,1)^t\). It is easy to see that the amount of space that will be covered by the spheres is
\[ \text{Volume of an }n\text{-sphere of radius }d_n\times\text{Density of the lattice}}. \]
There are known upper bounds on the greatest proportion of the space that can be covered in that way [4]. If we divide the proportion of the space covered in the current lattice by such an upper bound, the number obtained is what we call normalized. This means that the number we will get will be somewhere between 0 and 1 and that it can be used to compare the distribution of the points of the lattice with the points of other lattices. Having a value closer to 1 means a more evenly distributed lattice in some way (see the section on the figures of merit to see which tests use this in the intro). This class is intended as an interface to implement such bounds. It is possible that subclasses of this one implement bounds for a different interpretation of this problem, please look at their documentation before using them. The bounds also sometimes use different norms.
This base classe initializes the bounds at 1 and can be used if no normalization can be done, or has to be done. This can be usefull in a few implementations if there is a switch at runtime to instanciate a Normalizer
subclass because there will be no need to duplicate the code for the case with no normalization.
To create a subclass of this one, it is important to implement the getGamma(int) const, getBound(int) const and init() methods and to call the init() method in the constructor to pre-compute the bounds this class will use for normalization.
To instanciate this class or its subclasses, the usage of the copy constructor or of the assignment = is prohibited by the fact that these methods are private. The prefered usage for this class is to declare a pointer to a Normalizer and to instanciate subclasses with dynamically allocated memory:
LatticeTester::Normalizer< RedDbl >::Normalizer | ( | RedDbl & | logDensity, |
int | t, | ||
std::string | Name, | ||
NormType | norm = L2NORM , |
||
double | beta = 1 |
||
) |
Complete constructor for a Normalizer
.
This will create a normalizer for lattices with a density of \(\exp(\text{logDensity})\) in all dimensions \(\leq t\). Ususally, such a normalizer will return bounds that take into a account the density. Name
allows the user to give a name to a normalizer object. This name will be printed by the ToString() method. It serves no purpose implementation-wise, but this can be usefull while debugging code. norm
is the NormType that will be used by this object. It cannot be changed. The usage of beta
is deprecated. This is a bias factor that can be usefull in the case where a figure of merit with numerous projections is computed. It can be used to give more weight to the first dimensions by taking \(\beta< 1\). It inflates the figures of merit by \((1/\beta)^t\), thus weakening the requirements for good results in large dimensions in a worst-case figure of merit. One normally uses \(\beta= 1\).
Note that the log value of the density is stored (instead of the density itself) so it is easier to manipulate really large values of density.
beta
devrait disparaître car des poids beaucoup plus généraux sont maintenant implantés dans les classes *Weights
. Marc-Antoine: Je crois que le design de cette classe est à repenser. Il est probablement intéressant de considérer la logDensity en tableaux parce que dans certaines applications la densité change en fonction de la dimension. LatticeTester::Normalizer< RedDbl >::Normalizer | ( | int | t, |
std::string | Name, | ||
NormType | norm = L2NORM , |
||
double | beta = 1 |
||
) |
Constructor that does not take the density as an argument.
The fields are essentially the same as for Normalizer(RedDbl, int, std::string, NormType, double)
This is only used in the case of rank 1 lattices in the NormaPalpha class with a prime density.
|
inlinevirtual |
Destructor.
|
virtual |
Calculates and returns the bound on the length of the shortest nonzero vector in dimension j
.
|
inline |
Returns the maximal dimension for this object.
This is the t
parameter of the constructors.
|
virtual |
Returns the value of a lattice constant \(\gamma\) in dimension \(j\).
These constants can be used by subclasses to implement the init() and the getBound(int) const methods. For this base class, always returns 1.
Reimplemented in LatticeTester::NormaRogers< RedDbl >, LatticeTester::NormaLaminated< RedDbl >, LatticeTester::NormaBestLat< RedDbl >, LatticeTester::NormaBestBound< RedDbl >, LatticeTester::NormaMinkL1< RedDbl >, and LatticeTester::NormaMinkowski< RedDbl >.
|
inline |
Returns the logDensity
associated with this object.
|
inline |
Returns the norm associated with this object.
double LatticeTester::Normalizer< RedDbl >::getPreComputedBound | ( | int | j | ) | const |
Returns the bound for dimension j
as computed in Normalizer::init().
|
virtual |
This is a method that will initialize the bounds this normalizer can return.
This will change the logDensity
and the beta
variables that are stored in this object. This will compute bounds for all dimensions smaller than t
(the parameter passed to the constructors) that can be retrived with the getPreComputedBounds(int) method.
|
inline |
Sets the log-density associated with this object to logDensity
.
|
inline |
Sets the norm associated with this object to norm
.
std::string LatticeTester::Normalizer< RedDbl >::ToString | ( | ) | const |
Returns a string that describes this object.
|
protected |
Beta factor used to give more or less importance to some of the dimensions.
|
protected |
Contains the bounds on the length of the shortest nonzero vector in the lattice in each dimension.
This array is initialized by the init() method, and it's values are returned with getPreComputedBound(int).
|
protected |
log of the density, ie log of the number of points of the lattice per unit of volume.
|
protected |
Only elements 1 to m_maxDim
(inclusive) of m_bounds bellow will be pre-computed.
This stores the t
parameter of the constructors.
|
protected |
Name of the normalizer.
|
protected |
Norm associated with this object.
|
static |
The maximum dimension of the lattices for which this class can give an upper bound.