bkz_param.h
Go to the documentation of this file.
1#ifndef BKZ_PARAM_H
2#define BKZ_PARAM_H
3
4/* (C) 2014-2016 Martin Albrecht.
5
6 This file is part of fplll. fplll is free software: you can
7 redistribute it and/or modify it under the terms of the GNU Lesser
8 General Public License as published by the Free Software
9 Foundation, either version 2.1 of the License, or (at your option)
10 any later version.
11
12 fplll is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with fplll. If not, see
19 <http://www.gnu.org/licenses/>.
20
21*/
22
23#include "defs.h"
24#include "pruner/pruner.h"
25#include <string>
26#include <vector>
27
29
35{
36public:
37 size_t block_size; //< block size
38 vector<PruningParams> pruning_parameters; //< Pruning parameters
39 vector<size_t> preprocessing_block_sizes; //< For each block size we run one tour
40
49 {
50 Strategy strat;
51 strat.block_size = block_size;
52 strat.pruning_parameters.emplace_back(PruningParams());
53 return strat;
54 };
55
65 const PruningParams &get_pruning(double radius, double gh) const;
66};
67
69{
70public:
110 BKZParam(int block_size, vector<Strategy> &strategies, double delta = LLL_DEF_DELTA,
111 int flags = BKZ_DEFAULT, int max_loops = 0, double max_time = 0,
122 {
123
124 // we create dummy strategies
125 if (strategies.empty())
126 {
127 strategies = vector<Strategy>();
128 for (long b = 0; b <= block_size; ++b)
129 {
130 strategies.emplace_back(Strategy::EmptyStrategy(b));
131 }
132 }
133 };
134
137
139 vector<Strategy> &strategies;
140
142 double delta;
143
145 int flags;
146
149
151 double max_time;
152
158
162 double gh_factor;
163
168
172
176};
177
184vector<Strategy> load_strategies_json(const std::string &filename);
185
190const std::string &default_strategy_path();
191
196const std::string &default_strategy();
197
202const std::string strategy_full_path(const string &strategy_path);
203
205#endif /* BKZ_PARAM_H */
const std::string strategy_full_path(const string &strategy_path)
Definition: bkz_param.cpp:45
const std::string & default_strategy()
Definition: bkz_param.cpp:56
vector< Strategy > load_strategies_json(const std::string &filename)
Definition: bkz_param.cpp:80
const std::string & default_strategy_path()
Definition: bkz_param.cpp:39
Definition: bkz_param.h:69
int flags
Definition: bkz_param.h:145
string dump_gso_filename
Definition: bkz_param.h:167
BKZParam(int block_size, vector< Strategy > &strategies, double delta=LLL_DEF_DELTA, int flags=BKZ_DEFAULT, int max_loops=0, double max_time=0, double auto_abort_scale=BKZ_DEF_AUTO_ABORT_SCALE, int auto_abort_max_no_dec=BKZ_DEF_AUTO_ABORT_MAX_NO_DEC, double gh_factor=BKZ_DEF_GH_FACTOR, double min_success_probability=BKZ_DEF_MIN_SUCCESS_PROBABILITY, int rerandomization_density=BKZ_DEF_RERANDOMIZATION_DENSITY)
Create BKZ parameters.
Definition: bkz_param.h:110
vector< Strategy > & strategies
Definition: bkz_param.h:139
int auto_abort_max_no_dec
Definition: bkz_param.h:157
double delta
Definition: bkz_param.h:142
double max_time
Definition: bkz_param.h:151
int rerandomization_density
Definition: bkz_param.h:175
int max_loops
Definition: bkz_param.h:148
double min_success_probability
Definition: bkz_param.h:171
int block_size
Definition: bkz_param.h:136
double auto_abort_scale
Definition: bkz_param.h:156
double gh_factor
Definition: bkz_param.h:162
Definition: pruner.h:32
Definition: bkz_param.h:35
vector< size_t > preprocessing_block_sizes
Definition: bkz_param.h:39
size_t block_size
Definition: bkz_param.h:37
static Strategy EmptyStrategy(size_t block_size)
Definition: bkz_param.h:48
vector< PruningParams > pruning_parameters
Definition: bkz_param.h:38
const PruningParams & get_pruning(double radius, double gh) const
Definition: bkz_param.cpp:62
const double LLL_DEF_DELTA
Definition: defs.h:143
const int BKZ_DEF_RERANDOMIZATION_DENSITY
Definition: defs.h:260
@ BKZ_DEFAULT
Definition: defs.h:264
#define FPLLL_END_NAMESPACE
Definition: defs.h:117
const double BKZ_DEF_GH_FACTOR
Definition: defs.h:258
const double BKZ_DEF_AUTO_ABORT_SCALE
Definition: defs.h:256
const int BKZ_DEF_AUTO_ABORT_MAX_NO_DEC
Definition: defs.h:257
const double BKZ_DEF_MIN_SUCCESS_PROBABILITY
Definition: defs.h:259
#define FPLLL_BEGIN_NAMESPACE
Definition: defs.h:114