util.cpp File Reference
#include "util.h"

Enumerations

enum  MinPrecAlgo { MINPREC_GSO , MINPREC_L2 }
 

Functions

static int compute_min_prec (double &rho, int d, double delta, double eta, double epsilon, MinPrecAlgo algo)
 
int gso_min_prec (double &rho, int d, double delta, double eta, double epsilon)
 
int l2_min_prec (int d, double delta, double eta, double epsilon)
 
int hlll_min_prec (int d_i, int n_i, double delta_d, double eta_d, double theta_d, double c_d)
 
void sphere_volume (FP_NR< mpfr_t > &volume, int d)
 
void cost_estimate (FP_NR< mpfr_t > &cost, const FP_NR< mpfr_t > &bound, const Matrix< FP_NR< mpfr_t > > &r, int dimMax)
 
const char * get_red_status_str (int status)
 
template<class ZT >
void zeros_first (ZZ_mat< ZT > &b, ZZ_mat< ZT > &u, ZZ_mat< ZT > &u_inv_t)
 
template<class ZT >
void zeros_last (ZZ_mat< ZT > &b, ZZ_mat< ZT > &u, ZZ_mat< ZT > &u_inv_t)
 
template void zeros_first< mpz_t > (ZZ_mat< mpz_t > &, ZZ_mat< mpz_t > &, ZZ_mat< mpz_t > &)
 
template void zeros_last< mpz_t > (ZZ_mat< mpz_t > &, ZZ_mat< mpz_t > &, ZZ_mat< mpz_t > &)
 
template void zeros_first< long > (ZZ_mat< long > &, ZZ_mat< long > &, ZZ_mat< long > &)
 
template void zeros_last< long > (ZZ_mat< long > &, ZZ_mat< long > &, ZZ_mat< long > &)
 
template void zeros_first< double > (ZZ_mat< double > &, ZZ_mat< double > &, ZZ_mat< double > &)
 
template void zeros_last< double > (ZZ_mat< double > &, ZZ_mat< double > &, ZZ_mat< double > &)
 

Variables

thread_local mpfr_t temp_mpfr
 
thread_local bool temp_mpfr_initialized {false}
 

Enumeration Type Documentation

◆ MinPrecAlgo

Enumerator
MINPREC_GSO 
MINPREC_L2 

Function Documentation

◆ compute_min_prec()

static int compute_min_prec ( double &  rho,
int  d,
double  delta,
double  eta,
double  epsilon,
MinPrecAlgo  algo 
)
static

◆ cost_estimate()

void cost_estimate ( FP_NR< mpfr_t > &  cost,
const FP_NR< mpfr_t > &  bound,
const Matrix< FP_NR< mpfr_t > > &  r,
int  dimMax 
)

Estimates the cost of the enumeration for SVP.

◆ get_red_status_str()

const char * get_red_status_str ( int  status)

Returns the string corresponding to an error code of LLL/BKZ.

◆ gso_min_prec()

int gso_min_prec ( double &  rho,
int  d,
double  delta,
double  eta,
double  epsilon = DEF_GSO_PREC_EPSILON 
)

Returns the minimum precision required to ensure that error bounds on the GSO are valid. Computes rho such that for all 0 <= i < d and 0 <= j <= i:

|r~_i - r_i| / r_i <= d * rho ^ (i + 1) * 2 ^ (2 - prec)

|mu~_(i,j) - mu_(i,j)| <= d * rho ^ (i + 1) * 2 ^ (4 - prec)

◆ hlll_min_prec()

int hlll_min_prec ( int  d_i,
int  n_i,
double  delta,
double  eta,
double  theta,
double  c 
)

Returns the minimum precision for the proved version of HLLL.

◆ l2_min_prec()

int l2_min_prec ( int  d,
double  delta,
double  eta,
double  epsilon 
)

Returns the minimum precision for the proved version of LLL.

◆ sphere_volume()

void sphere_volume ( FP_NR< mpfr_t > &  volume,
int  d 
)

Computes the volume of a d-dimensional hypersphere of radius 1.

◆ zeros_first()

template<class ZT >
void zeros_first ( ZZ_mat< ZT > &  b,
ZZ_mat< ZT > &  u,
ZZ_mat< ZT > &  u_inv_t 
)

◆ zeros_first< double >()

template void zeros_first< double > ( ZZ_mat< double > &  ,
ZZ_mat< double > &  ,
ZZ_mat< double > &   
)

◆ zeros_first< long >()

template void zeros_first< long > ( ZZ_mat< long > &  ,
ZZ_mat< long > &  ,
ZZ_mat< long > &   
)

◆ zeros_first< mpz_t >()

template void zeros_first< mpz_t > ( ZZ_mat< mpz_t > &  ,
ZZ_mat< mpz_t > &  ,
ZZ_mat< mpz_t > &   
)

◆ zeros_last()

template<class ZT >
void zeros_last ( ZZ_mat< ZT > &  b,
ZZ_mat< ZT > &  u,
ZZ_mat< ZT > &  u_inv_t 
)

◆ zeros_last< double >()

template void zeros_last< double > ( ZZ_mat< double > &  ,
ZZ_mat< double > &  ,
ZZ_mat< double > &   
)

◆ zeros_last< long >()

template void zeros_last< long > ( ZZ_mat< long > &  ,
ZZ_mat< long > &  ,
ZZ_mat< long > &   
)

◆ zeros_last< mpz_t >()

template void zeros_last< mpz_t > ( ZZ_mat< mpz_t > &  ,
ZZ_mat< mpz_t > &  ,
ZZ_mat< mpz_t > &   
)

Variable Documentation

◆ temp_mpfr

thread_local mpfr_t temp_mpfr

◆ temp_mpfr_initialized

thread_local bool temp_mpfr_initialized {false}