LatNet Builder Manual 2.1.3-6
Software Package for Constructing Highly Uniform Point Sets
|
Objects of this class can perform various tests on lattices. More...
#include <LatticeAnalysis.h>
Public Member Functions | |
LatticeAnalysis () | |
Base constructor for the case where the data will come from files. | |
LatticeAnalysis (Config< Int, BasIntMat > &config) | |
Constructor containing all the fields needed to perform a test. | |
~LatticeAnalysis () | |
Destructor. | |
bool | doTest (Config< Int, BasIntMat > &config) |
Launches the computation specified in config. | |
void | printTestResults (const char *infile) |
This prints the result of the last computation that was asked to this object, as well as the configuration used. | |
int | doTestFromInputFile (const char *datafile) |
Reads the parameters of the test in input text file datafile; then does the specified computation. | |
int | doTestFromDirectory (const char *dirname) |
Applies the method doTestFromInputFile to all the files with extension ".dat" in directory named dirname. | |
Config< Int, BasIntMat > * | getConfig () |
Protected Member Functions | |
bool | performBasis (Config< Int, BasIntMat > &config) |
This will perform a basis construction according to the configuration and the basis of config. | |
bool | performDual (Config< Int, BasIntMat > &config) |
This will perform a dual construction according to the configuration and the basis of config. | |
bool | performReduction (Config< Int, BasIntMat > &config) |
This will perform a lattice reduction according to the configuration and the basis of config. | |
bool | performShortest (Config< Int, BasIntMat > &config) |
This will solve the shortest vector problem according to the configuration and the basis of config. | |
bool | performMerit (Config< Int, BasIntMat > &config) |
This will compute a figure of merit according to the configuration and the basis of config. |
Protected Attributes | |
double | m_merit |
This contains the last figure of merit computed. | |
double | m_shortest |
This contains the length of the shortest vector that was last computed. |
Objects of this class can perform various tests on lattices.
There are two intended usages of this class.
The tests consist on the computation of one of the figures of merit enumerated in CriterionType. If the user intend to simply reduce a lattice basis, he should look into the Reducer module since it offers much more flexibility. This class curently only implements the spectral and the Beyer test.
To use this class it is imperative to instanciate a Reducer object with the basis of the lattice to analyse. After that, you have to pass, either by the constructor or by the various methods available, all the parameters necessary to do a test (these are listed under the empty constructor). Finally, you simply have to call the doTest() method and the m_merit field will contain the figure of merit that was asked for.
LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::LatticeAnalysis | ( | ) |
Base constructor for the case where the data will come from files.
In that case, the fields of the class will be instanciated when read. This constructor can also be used to create a default object for the class that will be populated one field at a time by the user.
If the user choose to fill by hand the fields that are needed, he needs to fill the following fields:
LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::LatticeAnalysis | ( | Config< Int, BasIntMat > & | config | ) |
Constructor containing all the fields needed to perform a test.
|
inline |
Destructor.
This will deallocate memory to m_normalizer if it is not null.
bool LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::doTest | ( | Config< Int, BasIntMat > & | config | ) |
Launches the computation specified in config.
This will not print the results, but they can be retrieved via the printTestResults() method. This will store the config passed to this object for printing latter.
References performBasis(), performDual(), performMerit(), performReduction(), performShortest(), and LatticeTester::Config< Int, BasIntMat >::prob.
Referenced by doTestFromInputFile().
int LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::doTestFromDirectory | ( | const char * | dirname | ) |
Applies the method doTestFromInputFile to all the files with extension ".dat" in directory named dirname.
This will print all the results, but will only keep in memory the results of the last computation done.
Returns 0 if all the tests completed successfully; returns a non-zero integer if there was an error. Even if there is an error with one of the files, this method will try to do the tests on all the files.
References doTestFromInputFile().
int LatticeTester::LatticeAnalysis< Int, BasInt, Dbl, RedDbl >::doTestFromInputFile | ( | const char * | datafile | ) |
Reads the parameters of the test in input text file datafile; then does the specified computation.
The format of the data file must be as presented in usage. This will also print the results of the test in the way specified by the configuration file.
The data file must always have the extension ".dat", but must be given as argument here without extension. For example, if the data file is named myLattice.dat, then the method must be called as doTestFromInputFile("myLattice").
This method returns 0 if the test completed successfully and returns a negative integer if there was an error.
References doTest(), printTestResults(), and LatticeTester::ParamReader< Int, BasInt, RedDbl >::read().
Referenced by doTestFromDirectory().
|
protected |
This will perform a dual construction according to the configuration and the basis of config.
config is stored in this object so that the results can be printed with printTestResults().
References LatticeTester::Config< Int, BasIntMat >::basis, LatticeTester::Config< Int, BasIntMat >::dual_basis, LatticeTester::BasisConstruction< BasInt >::DualConstruction(), and LatticeTester::Config< Int, BasIntMat >::m.
Referenced by doTest().
|
protected |
This will compute a figure of merit according to the configuration and the basis of config.
config is stored in this object so that the results can be printed with printTestResults().
References LatticeTester::abs(), LatticeTester::Config< Int, BasIntMat >::basis, NTL::conv(), LatticeTester::IntLatticeBasis< Int, BasInt, Dbl, RedDbl >::getBasis(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::getMaxLength(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::getMinLength(), LatticeTester::Normalizer< RedDbl >::getPreComputedBound(), m_merit, m_shortest, LatticeTester::Config< Int, BasIntMat >::NumCols, LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redBKZ(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redDieter(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redLLLNTL(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::reductMinkowski(), and LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::shortestVector().
Referenced by doTest().
|
protected |
This will perform a lattice reduction according to the configuration and the basis of config.
config is stored in this object so that the results can be printed with printTestResults().
References LatticeTester::Config< Int, BasIntMat >::basis, LatticeTester::IntLatticeBasis< Int, BasInt, Dbl, RedDbl >::getBasis(), LatticeTester::Config< Int, BasIntMat >::NumCols, LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redBKZ(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redDieter(), and LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redLLLNTL().
Referenced by doTest().
|
protected |
This will solve the shortest vector problem according to the configuration and the basis of config.
config is stored in this object so that the results can be printed with printTestResults().
References LatticeTester::Config< Int, BasIntMat >::basis, NTL::conv(), LatticeTester::IntLatticeBasis< Int, BasInt, Dbl, RedDbl >::getBasis(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::getMinLength(), m_shortest, LatticeTester::Config< Int, BasIntMat >::NumCols, LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redBKZ(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redDieter(), LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::redLLLNTL(), and LatticeTester::Reducer< Int, BasInt, Dbl, RedDbl >::shortestVector().
Referenced by doTest().
|
protected |
This contains the last figure of merit computed.
This is not erased when a new computation not requiring a figure of merit is done.
Referenced by performMerit(), and printTestResults().
|
protected |
This contains the length of the shortest vector that was last computed.
This is not erased when a new computation not requiring the shortest vector is done.
Referenced by performMerit(), performShortest(), and printTestResults().