19#ifndef FPLLL_ENUMERATE_BASE_H
20#define FPLLL_ENUMERATE_BASE_H
33inline void roundto(
int &dest,
const double &src) { dest = (int)round(src); }
34inline void roundto(
double &dest,
const double &src) { dest = round(src); }
37#define MAXTEMPLATEDDIMENSION 80
41#ifndef __has_attribute
42#define __has_attribute(x) 0
44#if __has_attribute(always_inline)
45#define ALWAYS_INLINE __attribute__((always_inline))
50#ifndef FORCE_ENUM_INLINE
51#define ENUM_ALWAYS_INLINE
53#define ENUM_ALWAYS_INLINE ALWAYS_INLINE
61 inline uint64_t
get_nodes(
const int level = -1)
const
65 return std::accumulate(
nodes.begin(),
nodes.end(), 0);
101 array<uint64_t, FPLLL_EXTENUM_MAX_EXTENUM_DIM>
nodes;
103 template <
int kk,
int kk_start,
bool dualenum,
bool findsubsols,
bool enable_reset>
struct opts
108 template <
int kk,
int kk_start,
bool dualenum,
bool findsubsols,
bool enable_reset>
111 template <
int kk_start,
bool dualenum,
bool findsubsols,
bool enable_reset>
117 template <
int kk,
bool dualenum,
bool findsubsols,
bool enable_reset>
128 template <
bool dualenum,
bool findsubsols,
bool enable_reset>
131 template <
bool dualenum,
bool findsubsols,
bool enable_reset>
void enumerate_loop();
141 std::fesetround(FE_TONEAREST);
Definition: enumerate_base.h:57
virtual void reset(enumf, int)=0
virtual void process_subsolution(int offset, enumf newdist)=0
bool dual
Definition: enumerate_base.h:74
int reset_depth
Definition: enumerate_base.h:95
int rounding_backup
Definition: enumerate_base.h:137
array< enumf, maxdim > center_partsum
Definition: enumerate_base.h:85
bool next_pos_up()
Definition: enumerate_base.h:145
array< enumf, maxdim > center
Definition: enumerate_base.h:89
void enumerate_recursive_wrapper()
Definition: enumerate_base.h:118
array< int, maxdim > center_partsum_begin
Definition: enumerate_base.h:86
int k_max
Definition: enumerate_base.h:97
void restore_rounding()
Definition: enumerate_base.h:143
array< enumf, maxdim > partdist
Definition: enumerate_base.h:89
bool resetflag
Definition: enumerate_base.h:76
virtual ~EnumerationBase()
Definition: enumerate_base.h:70
array< uint64_t, FPLLL_EXTENUM_MAX_EXTENUM_DIM > nodes
Definition: enumerate_base.h:101
array< enumxt, maxdim > x
Definition: enumerate_base.h:90
int k
Definition: enumerate_base.h:97
bool is_svp
Definition: enumerate_base.h:75
array< enumf, maxdim > rdiag
Definition: enumerate_base.h:80
int k_end
Definition: enumerate_base.h:81
array< enumf, maxdim > alpha
Definition: enumerate_base.h:89
int d
Definition: enumerate_base.h:81
enumf center_partsums[maxdim][maxdim]
Definition: enumerate_base.h:84
static const int maxdim
Definition: enumerate_base.h:59
bool finished
Definition: enumerate_base.h:98
void enumerate_recursive_dispatch(int kk)
array< enumf, maxdim > partdistbounds
Definition: enumerate_base.h:80
vector< int > _max_indices
Definition: enumerate_base.h:94
array< enumf, maxdim > subsoldists
Definition: enumerate_base.h:91
enumf mut[maxdim][maxdim]
Definition: enumerate_base.h:79
uint64_t get_nodes(const int level=-1) const
Definition: enumerate_base.h:61
array< enumxt, maxdim > ddx
Definition: enumerate_base.h:90
array< enumxt, maxdim > dx
Definition: enumerate_base.h:90
void save_rounding()
Definition: enumerate_base.h:138
void enumerate_recursive(opts<-1, kk_start, dualenum, findsubsols, enable_reset >)
Definition: enumerate_base.h:112
virtual void process_solution(enumf newmaxdist)=0
void enumerate_recursive(opts< kk, kk_start, dualenum, findsubsols, enable_reset >) ENUM_ALWAYS_INLINE
#define FPLLL_MAX_ENUM_DIM
Definition: config.h:11
#define FPLLL_END_NAMESPACE
Definition: defs.h:117
#define FPLLL_BEGIN_NAMESPACE
Definition: defs.h:114
FPLLL_BEGIN_NAMESPACE void roundto(int &dest, const double &src)
Definition: enumerate_base.h:33
#define ENUM_ALWAYS_INLINE
Definition: enumerate_base.h:51
fplll_extenum_enumf std::function< extenum_cb_set_config > std::function< extenum_cb_process_sol > std::function< extenum_cb_process_subsol > bool bool findsubsols
Definition: enumerate_ext_api.h:92
FPLLL_BEGIN_NAMESPACE typedef double enumf
Definition: nr.h:42
Definition: enumerate_base.h:104