test_svp.cpp File Reference
#include <cstring>
#include <fplll.h>
#include <test_utils.h>

Macros

#define TESTDATADIR   ".."
 

Enumerations

enum  Test {
  SVP_ENUM , DSVP_ENUM , DSVP_REDUCE , SVP_ENUM ,
  DSVP_ENUM , DSVP_REDUCE
}
 

Functions

double norm (const vector< Z_NR< mpz_t > > &v)
 
template<class ZT >
int test_svp (ZZ_mat< ZT > &A, vector< Z_NR< mpz_t > > &b)
 Test if SVP function returns vector with right norm. More...
 
template<class ZT >
int dual_length (FP_NR< mpfr_t > &norm, ZZ_mat< ZT > &A, const vector< Z_NR< mpz_t > > &coords)
 Compute the norm of a dual vector (specified by coefficients in the dual basis). More...
 
template<class ZT >
int test_dual_svp (ZZ_mat< ZT > &A, vector< Z_NR< mpz_t > > &b)
 Test if dual SVP function returns vector with right norm. More...
 
template<class ZT >
int test_dsvp_reduce (ZZ_mat< ZT > &A, vector< Z_NR< mpz_t > > &b)
 Test if dual SVP reduction returns reduced basis. More...
 
int test_svp_proved_vs_fast (size_t d, size_t d2)
 test that proved is no worse than fast. More...
 
int test_rank_defect ()
 
template<class ZT >
int test_filename (const char *input_filename, const char *output_filename, const Test test=SVP_ENUM)
 Test if SVP function returns vector with right norm. More...
 
int main ()
 Run SVP tests. More...
 

Macro Definition Documentation

◆ TESTDATADIR

#define TESTDATADIR   ".."

Enumeration Type Documentation

◆ Test

enum Test
Enumerator
SVP_ENUM 
DSVP_ENUM 
DSVP_REDUCE 
SVP_ENUM 
DSVP_ENUM 
DSVP_REDUCE 

Function Documentation

◆ dual_length()

template<class ZT >
int dual_length ( FP_NR< mpfr_t > &  norm,
ZZ_mat< ZT > &  A,
const vector< Z_NR< mpz_t > > &  coords 
)

Compute the norm of a dual vector (specified by coefficients in the dual basis).

Parameters
Ainput lattice
bcoefficients of shortest dual vector
Returns

◆ main()

int main ( )

Run SVP tests.

Returns

◆ norm()

double norm ( const vector< Z_NR< mpz_t > > &  v)
inline

◆ test_dsvp_reduce()

template<class ZT >
int test_dsvp_reduce ( ZZ_mat< ZT > &  A,
vector< Z_NR< mpz_t > > &  b 
)

Test if dual SVP reduction returns reduced basis.

Parameters
Ainput lattice
bshortest dual vector
Returns

◆ test_dual_svp()

template<class ZT >
int test_dual_svp ( ZZ_mat< ZT > &  A,
vector< Z_NR< mpz_t > > &  b 
)

Test if dual SVP function returns vector with right norm.

Parameters
Ainput lattice
bshortest dual vector
Returns

◆ test_filename()

template<class ZT >
int test_filename ( const char *  input_filename,
const char *  output_filename,
const Test  test = SVP_ENUM 
)

Test if SVP function returns vector with right norm.

Parameters
input_filenamefilename of an input lattice
output_filenamefilename of a shortest vector
Returns

◆ test_rank_defect()

int test_rank_defect ( )

◆ test_svp()

template<class ZT >
int test_svp ( ZZ_mat< ZT > &  A,
vector< Z_NR< mpz_t > > &  b 
)

Test if SVP function returns vector with right norm.

Parameters
Ainput lattice
bshortest vector
Returns

◆ test_svp_proved_vs_fast()

int test_svp_proved_vs_fast ( size_t  d,
size_t  d2 
)

test that proved is no worse than fast.

Parameters
dlarge dimension of initial lattice
d2enumeration dimension