defs.h File Reference
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iostream>
#include <limits>
#include <sstream>
#include <stdexcept>
#include <string>
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#include "fplll_config.h"
#include <gmp.h>
#include <mpfr.h>
#include "nr/dpe.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fplll
 

Macros

#define FPLLL_WITH_LONG_DOUBLE
 
#define FPLLL_WITH_DPE
 
#define FPLLL_WITH_ZDOUBLE
 
#define FPLLL_WITH_ZLONG
 
#define FPLLL_WITH_GETRUSAGE
 
#define FPLLL_INFO(x)
 
#define FPLLL_ABORT(x)
 
#define FPLLL_CHECK(x, y)
 
#define FPLLL_DEBUG_ABORT(x)
 
#define FPLLL_DEBUG_CHECK(x)
 
#define FPLLL_TRACE(x)
 
#define FPLLL_TRACE_IN(x)
 
#define FPLLL_BEGIN_NAMESPACE
 
#define FPLLL_END_NAMESPACE   }
 
#define FPLLL_DEFAULT_STRATEGY_PATH   ""
 
#define FPLLL_DEFAULT_STRATEGY   ""
 
#define PRUNER_ZEALOUS   (PRUNER_GRADIENT | PRUNER_NELDER_MEAD)
 

Enumerations

enum  RedStatus {
  RED_SUCCESS = 0 , RED_GSO_FAILURE = 2 , RED_BABAI_FAILURE = 3 , RED_LLL_FAILURE = 4 ,
  RED_ENUM_FAILURE = 5 , RED_BKZ_FAILURE = 6 , RED_BKZ_TIME_LIMIT = 7 , RED_BKZ_LOOPS_LIMIT = 8 ,
  RED_HLLL_FAILURE = 9 , RED_HLLL_NORM_FAILURE = 10 , RED_HLLL_SR_FAILURE = 11 , RED_URL_ERR = 12 ,
  RED_STATUS_MAX = 13
}
 
enum  LLLMethod { LM_WRAPPER = 0 , LM_PROVED = 1 , LM_HEURISTIC = 2 , LM_FAST = 3 }
 
enum  IntType { ZT_MPZ = 0 , ZT_LONG = 1 , ZT_DOUBLE = 2 }
 
enum  FloatType {
  FT_DEFAULT = 0 , FT_DOUBLE = 1 , FT_LONG_DOUBLE = 2 , FT_DPE = 3 ,
  FT_DD = 4 , FT_QD = 5 , FT_MPFR = 6
}
 
enum  LLLFlags { LLL_VERBOSE = 1 , LLL_EARLY_RED = 2 , LLL_SIEGEL = 4 , LLL_DEFAULT = 0 }
 
enum  SVPMethod { SVPM_FAST = 0 , SVPM_PROVED = 2 }
 
enum  CVPMethod { CVPM_FAST = 0 , CVPM_PROVED = 2 }
 
enum  SVPFlags { SVP_DEFAULT = 0 , SVP_VERBOSE = 1 , SVP_OVERRIDE_BND = 2 , SVP_DUAL = 4 }
 
enum  CVPFlags { CVP_DEFAULT = SVP_DEFAULT , CVP_VERBOSE = SVP_VERBOSE }
 
enum  BKZFlags {
  BKZ_DEFAULT = 0 , BKZ_VERBOSE = 1 , BKZ_NO_LLL = 2 , BKZ_MAX_LOOPS = 4 ,
  BKZ_MAX_TIME = 8 , BKZ_BOUNDED_LLL = 0x10 , BKZ_AUTO_ABORT = 0x20 , BKZ_DUMP_GSO = 0x40 ,
  BKZ_GH_BND = 0x80 , BKZ_SD_VARIANT = 0x100 , BKZ_SLD_RED = 0x200
}
 
enum  HKZFlags { HKZ_DEFAULT = 0 , HKZ_VERBOSE = 1 }
 
enum  PrunerMetric { PRUNER_METRIC_PROBABILITY_OF_SHORTEST = 0 , PRUNER_METRIC_EXPECTED_SOLUTIONS = 1 }
 
enum  PrunerFlags {
  PRUNER_CVP , PRUNER_START_FROM_INPUT = 0x2 , PRUNER_GRADIENT = 0x4 , PRUNER_NELDER_MEAD = 0x8 ,
  PRUNER_VERBOSE = 0x10 , PRUNER_HALF = 0x20 , PRUNER_SINGLE = 0x40
}
 

Variables

const int CPU_SIZE = 64
 
const int CPU_SIZE_1 = 53
 
const double MAX_LONG_FAST = 0x1p53
 
const long int EXPO_MAX = 53
 
const int MAX_EXP_DOUBLE = 1000
 
const int PREC_DOUBLE = 53
 
const int PREC_DD = 106
 
const int PREC_QD = 212
 
const double LLL_DEF_DELTA = 0.99
 
const double LLL_DEF_ETA = 0.51
 
const double LLL_DEF_EPSILON = 0.01
 
const int SIZE_RED_FAILURE_THRESH = 5
 
const double HLLL_DEF_THETA = 0.001
 
const double HLLL_DEF_C = 0.1
 
const char *const RED_STATUS_STR [RED_STATUS_MAX]
 
const char *const LLL_METHOD_STR [6] = {"wrapper", "proved", "heuristic", "fast"}
 
const char *const HLLL_METHOD_STR [4] = {"wrapper", "proved", "", "fast"}
 
const char *const INT_TYPE_STR [5] = {"mpz", "long", "double"}
 
const char *const FLOAT_TYPE_STR [7] = {"", "double", "long double", "dpe", "dd", "qd", "mpfr"}
 
const double BKZ_DEF_AUTO_ABORT_SCALE = 1.0
 
const int BKZ_DEF_AUTO_ABORT_MAX_NO_DEC = 5
 
const double BKZ_DEF_GH_FACTOR = 1.1
 
const double BKZ_DEF_MIN_SUCCESS_PROBABILITY = 0.5
 
const int BKZ_DEF_RERANDOMIZATION_DENSITY = 3
 

Macro Definition Documentation

◆ FPLLL_ABORT

#define FPLLL_ABORT (   x)
Value:
{ \
cerr << "fplll: " << x << endl; \
abort(); \
}

◆ FPLLL_BEGIN_NAMESPACE

#define FPLLL_BEGIN_NAMESPACE
Value:
namespace fplll \
{

◆ FPLLL_CHECK

#define FPLLL_CHECK (   x,
 
)
Value:
{ \
if (!(x)) \
FPLLL_ABORT(y); \
}

◆ FPLLL_DEBUG_ABORT

#define FPLLL_DEBUG_ABORT (   x)

◆ FPLLL_DEBUG_CHECK

#define FPLLL_DEBUG_CHECK (   x)

◆ FPLLL_DEFAULT_STRATEGY

#define FPLLL_DEFAULT_STRATEGY   ""

◆ FPLLL_DEFAULT_STRATEGY_PATH

#define FPLLL_DEFAULT_STRATEGY_PATH   ""

◆ FPLLL_END_NAMESPACE

#define FPLLL_END_NAMESPACE   }

◆ FPLLL_INFO

#define FPLLL_INFO (   x)
Value:
{ \
cerr << x << endl; \
}

◆ FPLLL_TRACE

#define FPLLL_TRACE (   x)

◆ FPLLL_TRACE_IN

#define FPLLL_TRACE_IN (   x)

◆ FPLLL_WITH_DPE

#define FPLLL_WITH_DPE

◆ FPLLL_WITH_GETRUSAGE

#define FPLLL_WITH_GETRUSAGE

◆ FPLLL_WITH_LONG_DOUBLE

#define FPLLL_WITH_LONG_DOUBLE

◆ FPLLL_WITH_ZDOUBLE

#define FPLLL_WITH_ZDOUBLE

◆ FPLLL_WITH_ZLONG

#define FPLLL_WITH_ZLONG

◆ PRUNER_ZEALOUS

#define PRUNER_ZEALOUS   (PRUNER_GRADIENT | PRUNER_NELDER_MEAD)

Enumeration Type Documentation

◆ BKZFlags

enum BKZFlags
Enumerator
BKZ_DEFAULT 
BKZ_VERBOSE 
BKZ_NO_LLL 
BKZ_MAX_LOOPS 
BKZ_MAX_TIME 
BKZ_BOUNDED_LLL 
BKZ_AUTO_ABORT 
BKZ_DUMP_GSO 
BKZ_GH_BND 
BKZ_SD_VARIANT 
BKZ_SLD_RED 

◆ CVPFlags

enum CVPFlags
Enumerator
CVP_DEFAULT 
CVP_VERBOSE 

◆ CVPMethod

enum CVPMethod
Enumerator
CVPM_FAST 
CVPM_PROVED 

◆ FloatType

enum FloatType
Enumerator
FT_DEFAULT 
FT_DOUBLE 
FT_LONG_DOUBLE 
FT_DPE 
FT_DD 
FT_QD 
FT_MPFR 

◆ HKZFlags

enum HKZFlags
Enumerator
HKZ_DEFAULT 
HKZ_VERBOSE 

◆ IntType

enum IntType
Enumerator
ZT_MPZ 
ZT_LONG 
ZT_DOUBLE 

◆ LLLFlags

enum LLLFlags
Enumerator
LLL_VERBOSE 
LLL_EARLY_RED 
LLL_SIEGEL 
LLL_DEFAULT 

◆ LLLMethod

enum LLLMethod
Enumerator
LM_WRAPPER 
LM_PROVED 
LM_HEURISTIC 
LM_FAST 

◆ PrunerFlags

Enumerator
PRUNER_CVP 
PRUNER_START_FROM_INPUT 
PRUNER_GRADIENT 
PRUNER_NELDER_MEAD 
PRUNER_VERBOSE 
PRUNER_HALF 
PRUNER_SINGLE 

◆ PrunerMetric

Enumerator
PRUNER_METRIC_PROBABILITY_OF_SHORTEST 
PRUNER_METRIC_EXPECTED_SOLUTIONS 

◆ RedStatus

enum RedStatus
Enumerator
RED_SUCCESS 
RED_GSO_FAILURE 
RED_BABAI_FAILURE 
RED_LLL_FAILURE 
RED_ENUM_FAILURE 
RED_BKZ_FAILURE 
RED_BKZ_TIME_LIMIT 
RED_BKZ_LOOPS_LIMIT 
RED_HLLL_FAILURE 
RED_HLLL_NORM_FAILURE 
RED_HLLL_SR_FAILURE 
RED_URL_ERR 
RED_STATUS_MAX 

◆ SVPFlags

enum SVPFlags
Enumerator
SVP_DEFAULT 
SVP_VERBOSE 
SVP_OVERRIDE_BND 
SVP_DUAL 

◆ SVPMethod

enum SVPMethod
Enumerator
SVPM_FAST 
SVPM_PROVED 

Variable Documentation

◆ BKZ_DEF_AUTO_ABORT_MAX_NO_DEC

const int BKZ_DEF_AUTO_ABORT_MAX_NO_DEC = 5

◆ BKZ_DEF_AUTO_ABORT_SCALE

const double BKZ_DEF_AUTO_ABORT_SCALE = 1.0

◆ BKZ_DEF_GH_FACTOR

const double BKZ_DEF_GH_FACTOR = 1.1

◆ BKZ_DEF_MIN_SUCCESS_PROBABILITY

const double BKZ_DEF_MIN_SUCCESS_PROBABILITY = 0.5

◆ BKZ_DEF_RERANDOMIZATION_DENSITY

const int BKZ_DEF_RERANDOMIZATION_DENSITY = 3

◆ CPU_SIZE

const int CPU_SIZE = 64

◆ CPU_SIZE_1

const int CPU_SIZE_1 = 53

◆ EXPO_MAX

const long int EXPO_MAX = 53

◆ FLOAT_TYPE_STR

const char* const FLOAT_TYPE_STR[7] = {"", "double", "long double", "dpe", "dd", "qd", "mpfr"}

◆ HLLL_DEF_C

const double HLLL_DEF_C = 0.1

◆ HLLL_DEF_THETA

const double HLLL_DEF_THETA = 0.001

◆ HLLL_METHOD_STR

const char* const HLLL_METHOD_STR[4] = {"wrapper", "proved", "", "fast"}

◆ INT_TYPE_STR

const char* const INT_TYPE_STR[5] = {"mpz", "long", "double"}

◆ LLL_DEF_DELTA

const double LLL_DEF_DELTA = 0.99

◆ LLL_DEF_EPSILON

const double LLL_DEF_EPSILON = 0.01

◆ LLL_DEF_ETA

const double LLL_DEF_ETA = 0.51

◆ LLL_METHOD_STR

const char* const LLL_METHOD_STR[6] = {"wrapper", "proved", "heuristic", "fast"}

◆ MAX_EXP_DOUBLE

const int MAX_EXP_DOUBLE = 1000

◆ MAX_LONG_FAST

const double MAX_LONG_FAST = 0x1p53

◆ PREC_DD

const int PREC_DD = 106

◆ PREC_DOUBLE

const int PREC_DOUBLE = 53

◆ PREC_QD

const int PREC_QD = 212

◆ RED_STATUS_STR

const char* const RED_STATUS_STR[RED_STATUS_MAX]
Initial value:
= {
"success",
"",
"infinite number in GSO",
"infinite loop in babai",
"infinite loop in LLL",
"error in SVP solver",
"error in BKZ",
"time limit exceeded in BKZ",
"loops limit exceeded in BKZ",
"error in HLLL",
"increase of the norm",
"error in weak size reduction",
"Please see https://github.com/fplll/fplll/wiki/fplll-errors-FAQ for more information."}

◆ SIZE_RED_FAILURE_THRESH

const int SIZE_RED_FAILURE_THRESH = 5