Lattice Builder Manual
Software Package for Constructing Rank-1 Lattices
|
This class represents a basis for a lattice. More...
#include <Base.h>
Inherits BMat.
Public Member Functions | |
Base (int d, int maxDim, NormType norm=L2NORM) | |
Constructor. More... | |
Base (const Base &) | |
Copy constructor. | |
~Base () | |
Destructor. | |
Base & | operator= (const Base &) |
Assignment operator. | |
void | kill () |
Cleans and releases all memory used by the basis. | |
void | swap (Base &b) |
Swaps this basis with the basis b . | |
void | permute (int i, int j) |
Exchanges vectors \(i\) and \(j\) in the basis. | |
int | getDim () const |
Returns the actual dimension of the basis. | |
void | setDim (int d) |
Resets the actual dimension of the basis to d , but does not reserve any new memory. | |
int | getMaxDim () const |
Returns the maximal dimension of the basis. | |
NormType | getNorm () const |
Returns the norm used by the basis. | |
void | setNorm (NormType norm) |
Sets the norm used by the basis. | |
bool | isNegativeNorm (int i) const |
Returns true if the \(i\)-th vector's norm is not updated and erroneous. More... | |
void | setNegativeNorm (bool flag) |
Sets the dirty flag of the norms to flag . | |
void | setNegativeNorm (bool flag, int j) |
Sets the negative flag for the \(j\)-th vector to flag . | |
NScal | getVecNorm (int i) const |
Returns the \(i\)-th vector's norm. | |
void | setVecNorm (NScal &value, int i) |
Sets the \(i\)-th vector's norm to value . More... | |
void | updateVecNorm () |
Recalculates the norm of each vector in the basis. | |
void | updateVecNorm (int d) |
Same as above, except that the recalculation begins at dimension d + 1. | |
void | updateScalL2Norm (int d) |
Updates the norm of vector at dimension d using the L2NORM . | |
void | updateScalL2Norm (int d1, int d2) |
Updates the norm of all basis vectors from dimensions d1 to d2 (inclusive) using the L2NORM . | |
std::string | toString () const |
Writes the basis in a string and returns it. | |
std::string | toString (int i) const |
Writes the \(i\)-th basis vector in a string and returns it. | |
void | write () const |
Writes the basis on standard output. | |
void | write (int i) const |
Writes \(i\)-th basis vector on standard output. | |
Protected Attributes | |
int | m_dim |
Actual dimension of the basis. | |
int | m_maxDim |
Maximum dimension of the basis. | |
NormType | m_norm |
Norm used to calculate the norm of the vectors. | |
NVect | m_vecNorm |
The norm of each vector in the basis. | |
bool * | m_negFlag |
Indicates whether a vector norm must be recalculated or not. | |
This class represents a basis for a lattice.
To compute the length of vectors, one may use either the \(L_1\), the \(L_2\) or the \(L_\infty\) norms. If one uses the \(L_2\) norm and if BScal
and NScal
are of type double
, then the norm could overflow if the components of the basis vectors are larger than \(\approx 2^{500}\). In that case, NScal
may be chosen as RR
. If one uses the \(L_1\) or the \(L_\infty\) norms, NScal
may be chosen the same as BScal
.
LatCommon::Base::Base | ( | int | d, |
int | maxDim, | ||
NormType | norm = L2NORM |
||
) |
Constructor.
Builds a basis of actual dimension \(d\), maximum dimension maxDim
and with norm norm
.
|
inline |
Returns true
if the \(i\)-th vector's norm is not updated and erroneous.
Returns false
otherwise.
References m_negFlag.
void LatCommon::Base::setVecNorm | ( | NScal & | value, |
int | i | ||
) |
Sets the \(i\)-th vector's norm to value
.
The negative flag for this vector is set to false and no data integrity is made.