bkz.cpp File Reference
#include <iomanip>
#include "bkz.h"
#include "bkz_param.h"
#include "enum/enumerate.h"
#include "util.h"
#include "wrapper.h"

Functions

template<class FT >
int bkz_reduction_f (ZZ_mat< mpz_t > &b, const BKZParam &param, int sel_ft, double lll_delta, ZZ_mat< mpz_t > &u, ZZ_mat< mpz_t > &u_inv)
 
int bkz_reduction (ZZ_mat< mpz_t > *B, ZZ_mat< mpz_t > *U, const BKZParam &param, FloatType float_type, int precision)
 Performs block reduction using BKZParam object. More...
 
int bkz_reduction (ZZ_mat< mpz_t > &b, int block_size, int flags, FloatType float_type, int precision)
 Performs block reduction without transformation matrix. More...
 
int bkz_reduction (ZZ_mat< mpz_t > &b, ZZ_mat< mpz_t > &u, int block_size, int flags, FloatType float_type, int precision)
 Performs block reduction with transformation matrix. More...
 
int hkz_reduction (ZZ_mat< mpz_t > &b, int flags, FloatType float_type, int precision)
 Performs HKZ reduction. More...
 

Function Documentation

◆ bkz_reduction() [1/3]

int bkz_reduction ( ZZ_mat< mpz_t > &  b,
int  block_size,
int  flags = BKZ_DEFAULT,
FloatType  float_type = FT_DEFAULT,
int  precision = 0 
)

Performs block reduction without transformation matrix.

Creates a parameter object corresponding to the parameters and calls bkz_reduction on it.

Parameters
bbasis of the lattice to be reduced
block_sizeblock_size of the reduction
flagsdifferent flags for reduction (see defs.h and bkz_param.h for more information)
float_typespecifies the data type used for GSO computations (see defs.h for options)
precisionspecifies the precision if float_type=FT_MPFR (and needs to be > 0 in that case) ignored otherwise
Returns
the status of the reduction (see defs.h for more information on the status)

◆ bkz_reduction() [2/3]

int bkz_reduction ( ZZ_mat< mpz_t > &  b,
ZZ_mat< mpz_t > &  u,
int  block_size,
int  flags = BKZ_DEFAULT,
FloatType  float_type = FT_DEFAULT,
int  precision = 0 
)

Performs block reduction with transformation matrix.

Creates a parameter object corresponding to the parameters and calls bkz_reduction on it.

Parameters
bbasis of the lattice to be reduced
utransformation matrix
block_sizeblock_size of the reduction
flagsdifferent flags for reduction (see defs.h and bkz_param.h for more information)
float_typespecifies the data type used for GSO computations (see defs.h for options)
precisionspecifies the precision if float_type=FT_MPFR (and needs to be > 0 in that case) ignored otherwise
Returns
the status of the reduction (see defs.h for more information on the status)

◆ bkz_reduction() [3/3]

int bkz_reduction ( ZZ_mat< mpz_t > *  B,
ZZ_mat< mpz_t > *  U,
const BKZParam param,
FloatType  float_type = FT_DEFAULT,
int  precision = 0 
)

Performs block reduction using BKZParam object.

Parameters
Bbasis of the lattice to be reduced
Utransformation matrix (pass an empty matrix to ignore this option)
paramparameter object
float_typespecifies the data type used for GSO computations (see defs.h for options)
precisionspecifies the precision if float_type=FT_MPFR (and needs to be > 0 in that case) ignored otherwise
Returns
the status of the reduction (see defs.h for more information on the status)

◆ bkz_reduction_f()

template<class FT >
int bkz_reduction_f ( ZZ_mat< mpz_t > &  b,
const BKZParam param,
int  sel_ft,
double  lll_delta,
ZZ_mat< mpz_t > &  u,
ZZ_mat< mpz_t > &  u_inv 
)

◆ hkz_reduction()

int hkz_reduction ( ZZ_mat< mpz_t > &  b,
int  flags = HKZ_DEFAULT,
FloatType  float_type = FT_DEFAULT,
int  precision = 0 
)

Performs HKZ reduction.

Creates a parameter object corresponding to the parameters (and block size equal to the dimension) and calls bkz_reduction on it.

Parameters
bbasis of the lattice to be reduced
flagsflags for reduction (HKZ_DEFAULT or HKZ_VERBOSE)
float_typespecifies the data type used for GSO computations (see defs.h for options)
precisionspecifies the precision if float_type=FT_MPFR (and needs to be > 0 in that case) ignored otherwise
Returns
the status of the reduction (see defs.h for more information on the status)