45 template<
typename Iterator,
typename Skipper>
54 namespace phx = boost::phoenix;
64 using boost::spirit::lexeme;
65 using boost::spirit::as_string;
66 using boost::spirit::ascii::no_case;
70 std::string level_name =
"securitylevel";
71 std::string maxnorm_name =
"securitymaxnorm";
74 root_rule_.name(
"config::Security");
84 >> -no_setting_) | no_setting_;
86 all_names_ = (no_case[level_name] >>
':') | (no_case[maxnorm_name] >>
':');
88 security_level_.name(
"security_level_");
89 security_level_ = *(char_ - all_names_) >> (no_case[level_name] >>
':') >> qi::int_[_val = _1] >>
';';
91 security_max_norm_.name(
"security_max_norm_");
92 security_max_norm_ = *(char_ - all_names_) >> (no_case[maxnorm_name] >>
':')
93 >> mpfr_rules.number_string_[phx::bind( [](
T & num, std::string str)
96 }, _val, _1 )] >>
';';
98 no_setting_.name(
"no_setting_");
99 no_setting_ = *(char_ - all_names_);
101 no_decl_.name(
"no_decl_");
107 qi::on_error<qi::fail>(
109 phx::bind(&
ReportParseError, _1, _2, _3, _4, std::string(
"config::Security"))
119 qi::rule<Iterator, int(), ascii::space_type > security_level_;
120 qi::rule<Iterator, T(), ascii::space_type > security_max_norm_;
121 qi::rule<Iterator, ascii::space_type, std::string()> no_decl_, no_setting_, all_names_;
122 rules::LongNum<Iterator> mpfr_rules;
135 template<
typename Iterator,
typename Skipper>
145 namespace phx = boost::phoenix;
155 using boost::spirit::lexeme;
156 using boost::spirit::as_string;
157 using boost::spirit::ascii::no_case;
161 std::string samplefactor_name =
"samplefactor";
162 std::string numpoints_name =
"numsamplepoints";
163 std::string mintrack_name =
"nbhdradius";
164 std::string final_tol_name =
"finaltol";
167 root_rule_.name(
"config::Endgame");
190 all_names_ = (no_case[samplefactor_name] >>
':') | (no_case[numpoints_name] >>
':')| (no_case[mintrack_name] >>
':')
191 | (no_case[final_tol_name] >>
':');
193 sample_factor_.name(
"sample_factor_");
194 sample_factor_ = *(char_ - all_names_) >> (no_case[samplefactor_name] >>
':')
195 >> mpfr_rules.rational[phx::bind( [](
R & num, std::string
const& str)
198 }, _val, _1 )] >>
';';
200 min_track_.name(
"min_track_");
201 min_track_ = *(char_ - all_names_) >> (no_case[mintrack_name] >>
':')
202 >> mpfr_rules.number_string_[phx::bind( [](
T & num, std::string str)
205 }, _val, _1 )] >>
';';
207 num_sample_.name(
"num_sample_");
208 num_sample_ = *(char_ - all_names_) >> (no_case[numpoints_name] >>
':')
209 >> qi::uint_[_val=_1] >>
';';
211 final_tol_.name(
"final_tol_");
212 final_tol_ = *(char_ - all_names_) >> (no_case[final_tol_name] >>
':')
213 >> mpfr_rules.number_string_[phx::bind( [](
T & num, std::string str)
216 }, _val, _1 )] >>
';';
218 no_setting_.name(
"no_setting_");
219 no_setting_ = *(char_ - all_names_);
221 no_decl_.name(
"no_decl_");
228 qi::on_error<qi::fail>(
230 phx::bind(&
ReportParseError, _1, _2, _3, _4, std::string(
"config::Endgame"))
240 qi::rule<Iterator, R(), ascii::space_type > sample_factor_;
241 qi::rule<Iterator, T(), ascii::space_type > min_track_, final_tol_;
242 qi::rule<Iterator,
unsigned int(), ascii::space_type > num_sample_;
243 qi::rule<Iterator, ascii::space_type, std::string()> no_decl_, no_setting_, all_names_;
244 rules::LongNum<Iterator> mpfr_rules;
254 template<
typename Iterator,
typename Skipper>
262 namespace phx = boost::phoenix;
272 using boost::spirit::lexeme;
273 using boost::spirit::as_string;
274 using boost::spirit::ascii::no_case;
278 std::string maxcycle_name =
"maxcyclenum";
281 root_rule_.name(
"bertini::endgame::PowerSeriesConfig");
293 all_names_ = eps >> (no_case[maxcycle_name] >>
':');
295 max_cycle_.name(
"max_cycle_");
296 max_cycle_ = *(char_ - all_names_) >> (no_case[maxcycle_name] >>
':') >> qi::uint_[_val=_1] >>
';';
298 no_setting_.name(
"no_setting_");
299 no_setting_ = *(char_ - all_names_);
301 no_decl_.name(
"no_decl_");
308 qi::on_error<qi::fail>(
310 phx::bind(&
ReportParseError, _1, _2, _3, _4, std::string(
"bertini::endgame::PowerSeriesConfig"))
320 qi::rule<Iterator,
unsigned int(), ascii::space_type > max_cycle_;
321 qi::rule<Iterator, ascii::space_type, std::string()> no_decl_, no_setting_, all_names_;
331 template<
typename Iterator,
typename Skipper>
339 namespace phx = boost::phoenix;
349 using boost::spirit::lexeme;
350 using boost::spirit::as_string;
351 using boost::spirit::ascii::no_case;
355 std::string cyclecutoff_name =
"cycletimecutoff";
356 std::string ratiocutoff_name =
"ratiotimecutoff";
359 root_rule_.name(
"config::Cauchy");
369 >> -no_setting_) | no_setting_;
371 all_names_ = (no_case[cyclecutoff_name] >>
':') | (no_case[ratiocutoff_name] >>
':');
373 cycle_cutoff_.name(
"cycle_cutoff_");
374 cycle_cutoff_ = *(char_ - all_names_) >> (no_case[cyclecutoff_name] >>
':')
375 >> mpfr_rules.number_string_[phx::bind( [](
T & num, std::string str)
378 }, _val, _1 )] >>
';';
380 ratio_cutoff_.name(
"ratio_cutoff_");
381 ratio_cutoff_ = *(char_ - all_names_) >> (no_case[ratiocutoff_name] >>
':')
382 >> mpfr_rules.number_string_[phx::bind( [](
T & num, std::string str)
385 }, _val, _1 )] >>
';';
387 no_setting_.name(
"no_setting_");
388 no_setting_ = *(char_ - all_names_);
390 no_decl_.name(
"no_decl_");
396 qi::on_error<qi::fail>(
408 qi::rule<Iterator, T(), ascii::space_type > cycle_cutoff_, ratio_cutoff_;
409 qi::rule<Iterator, ascii::space_type, std::string()> no_decl_, no_setting_, all_names_;
410 rules::LongNum<Iterator> mpfr_rules;
418 template<
typename Iterator,
typename Skipper>
426 namespace phx = boost::phoenix;
436 using boost::spirit::lexeme;
437 using boost::spirit::as_string;
438 using boost::spirit::ascii::no_case;
442 std::string min_cycle_name =
"mincycletrackback";
443 std::string junk_removal_name =
"junkremovaltrackback";
444 std::string maxdepth_name =
"maxldtdepth";
446 root_rule_.name(
"bertini::endgame::TrackBackConfig");
461 >> -no_setting_) | no_setting_;
465 all_names_ = eps >> (no_case[min_cycle_name] >>
':') |
466 (no_case[junk_removal_name] >>
':') |
467 (no_case[maxdepth_name] >>
':');
469 min_cycle_.name(
"min_cycle_");
470 min_cycle_ = *(char_ - all_names_) >> (no_case[min_cycle_name] >>
':') >> qi::uint_[_val=_1] >>
';';
472 junk_removal_.name(
"junk_removal_");
473 junk_removal_ = *(char_ - all_names_) >> (no_case[junk_removal_name] >>
':') >> qi::int_[_val=_1] >>
';';
475 max_depth_.name(
"max_depth_");
476 max_depth_ = *(char_ - all_names_) >> (no_case[maxdepth_name] >>
':') >> qi::uint_[_val=_1] >>
';';
478 no_setting_.name(
"no_setting_");
479 no_setting_ = *(char_ - all_names_);
481 no_decl_.name(
"no_decl_");
488 qi::on_error<qi::fail>(
490 phx::bind(&
ReportParseError, _1, _2, _3, _4, std::string(
"bertini::endgame::TrackBackConfig"))
500 qi::rule<Iterator,
unsigned int(), ascii::space_type > min_cycle_, max_depth_;
501 qi::rule<Iterator, int(), ascii::space_type > junk_removal_;
502 qi::rule<Iterator, ascii::space_type, std::string()> no_decl_, no_setting_, all_names_;
Provides the base type for config settings parsers.
Configs and settings for endgames.
Definition classic_utilities.hpp:41
void ReportParseError(std::string::const_iterator begin, std::string::const_iterator end, std::string::const_iterator err_pos, boost::spirit::info const &what, std::string const &parser_name)
Report a parse error (via FormatParseError) to the log, for use in a Spirit on_error handler.
Definition qi_files.hpp:199
Definition classic_utilities.hpp:40
Definition algorithm_builder.hpp:36
boost::multiprecision::number< boost::multiprecision::backends::gmp_rational, boost::multiprecision::et_on > mpq_rational
The exact rational number type.
Definition mpfr_extensions.hpp:55
Numeric traits for a bertini number type: digit counts, conversions, and companion types.
Definition num_traits.hpp:57
Cauchy-endgame configuration.
Definition config.hpp:142
T ratio_cutoff_time
Time below which the c/k ratio test stops.
Definition config.hpp:146
T cycle_cutoff_time
Time below which the cycle-number heuristic stops.
Definition config.hpp:145
Configuration common to all endgames (sampling and final-approximation tolerances).
Definition config.hpp:103
T final_tolerance
The tolerance to which to compute the endpoint using the endgame.
Definition config.hpp:113
unsigned num_sample_points
Number of sample points used per approximation.
Definition config.hpp:106
T min_track_time
Smallest time the endgame will track to (the neighborhood radius).
Definition config.hpp:107
mpq_rational sample_factor
Geometric factor between successive sample times (exact rational).
Definition config.hpp:109
Power-series-endgame configuration.
Definition config.hpp:134
unsigned max_cycle_number
Largest cycle number to consider.
Definition config.hpp:135
Security (divergence-bailout) configuration for an endgame.
Definition config.hpp:95
int level
Security level; >0 disables the max-norm divergence check.
Definition config.hpp:96
NumErrorT max_norm
A path diverges if its norm exceeds this during the endgame.
Definition config.hpp:97
Track-back endgame configuration.
Definition config.hpp:167
unsigned minimum_cycle
Minimum cycle number for track-back.
Definition config.hpp:168
bool junk_removal_test
Whether to run the junk-removal test.
Definition config.hpp:169
unsigned max_depth_LDT
Maximum depth of the local dimension test.
Definition config.hpp:170
double T
The number type used by this parser.
Definition endgames.hpp:49
ConfigSettingParser()
Definition endgames.hpp:51
mpq_rational R
Exact rational type (decimal-to-rational, no floating-point precision to go stale).
Definition endgames.hpp:140
double T
The number type used by this parser.
Definition endgames.hpp:139
ConfigSettingParser()
Definition endgames.hpp:143
ConfigSettingParser()
Definition endgames.hpp:424
double T
The number type used by this parser.
Definition endgames.hpp:422
ConfigSettingParser()
Definition endgames.hpp:260
double T
The number type used by this parser.
Definition endgames.hpp:258
double T
The number type used by this parser.
Definition endgames.hpp:335
ConfigSettingParser()
Definition endgames.hpp:337