Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1//This file is part of Bertini 2.
2//
3//include/bertini2/endgames/config.hpp is free software: you can redistribute it and/or modify
4//it under the terms of the GNU General Public License as published by
5//the Free Software Foundation, either version 3 of the License, or
6//(at your option) any later version.
7//
8//include/bertini2/endgames/config.hpp is distributed in the hope that it will be useful,
9//but WITHOUT ANY WARRANTY; without even the implied warranty of
10//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11//GNU General Public License for more details.
12//
13//You should have received a copy of the GNU General Public License
14//along with include/bertini2/endgames/config.hpp. If not, see <http://www.gnu.org/licenses/>.
15//
16// Copyright(C) Bertini2 Development Team
17//
18// See <http://www.gnu.org/licenses/> for a copy of the license,
19// as well as COPYING. Bertini2 is provided with permitted
20// additional terms in the b2/licenses/ directory.
21
27
28#pragma once
29
33
34
35namespace bertini{ namespace endgame{
36
37
38 // // some forward declarations
39// base
40 template<class FlavorT, class PrecT>
41 class EndgameBase;
42
43// flavors
44 template<typename PrecT>
46
47 template<typename PrecT>
48 class CauchyEndgame;
49
50// precision types
51 template<typename TrackerT>
52 class FixedPrecEndgame;
53
54 class AMPEndgame;
55
56 // end forward declarations
57
58
59
63 template <typename TrackerT>
65
66 // specialize this in the specific files it goes in, please
67
68
69
70
71
84 template<typename TrackerT>
92
95 {
96 int level = 0;
98 };
99
100
103 {
104 using T = NumErrorT;
106 unsigned num_sample_points = 3;
107 T min_track_time = T(1e-100);
108
110
111 unsigned max_num_refinements = 4;
112
114
115 // When the adaptive-numeric-type (double-first) endgame crosses a sample set from double up into
116 // mpfr, the retained samples are widened (zero-padded) -- they were already tracked/refined to
117 // final_tolerance, so by default we do NOT spend a Newton refine to sharpen them. Set true to
118 // refine every retained sample to the new (higher) precision immediately after a precision
119 // increase. No effect on fixed-precision endgames.
121
122 // The operating-zone test, shared by every flavor since b2#402: successive c/k estimates
123 // settling is what says the cycle-number estimate has settled, and so that the Puiseux
124 // asymptotics dominate. These lived in CauchyConfig while the test did, for historical
125 // rather than mathematical reasons -- the estimate reads only the geometric approach
126 // samples, which every endgame maintains.
129 };
130
131
134 {
135 unsigned max_cycle_number = 6;
137 };
138
139
142 {
143 using T = NumErrorT;
144
145 T cycle_cutoff_time = T(1)/T(100000000);
146 T ratio_cutoff_time = T(1)/T(100000000000000);
147 // minimum_for_c_over_k_stabilization and num_needed_for_stabilization moved to
148 // EndgameConfig when the operating-zone test became shared (b2#402).
151
152 // Number of consecutive circle-tracked Cauchy approximations that must report the SAME cycle
153 // number before a converged approximation is trusted. Guards against an UNRELIABLE cycle
154 // number: when the working precision is too low to close the loop accurately (the circle of
155 // radius |t| has enough path variation that tracking error breaks closure -- NOT monodromy:
156 // at high precision a nonsingular endpoint closes at cycle 1 for every radius), the
157 // loop-closing count thrashes (e.g. 41, 14, 36). Requiring N consecutive identical cycle
158 // numbers refuses to accept convergence until the estimate has genuinely settled.
159 // See z_notes/20260629_endgame_stepsize_reset_rootcause.
161
162 };
163
164
167 {
168 unsigned minimum_cycle = 4;
170 unsigned max_depth_LDT = 3;
171 };
172
173
174 // an empty base class
175 template <typename T>
177
181 template<typename PrecT>
183 {
184 static constexpr char const* kRecordName = "powerseries";
185
191 >;
192
194 };
195
196
200 template<typename PrecT>
201 struct AlgoTraits< CauchyEndgame<PrecT>>
202 {
203 static constexpr char const* kRecordName = "cauchy";
204
210 };
211
212
213
214
215} } // namespaces
Specifies some necessaries for AMP style endgame implementations, which differ from the fixed precisi...
Definition amp_endgame.hpp:46
Class used to finish tracking paths during Homotopy Continuation.
Definition cauchy.hpp:166
Base endgame class for all endgames offered in Bertini2.
Definition base_endgame.hpp:91
Fixed-precision endgame precision policy (refines and ensures precision at a single working precision...
Definition fixed_prec_endgame.hpp:42
class used to finish tracking paths during Homotopy Continuation
Definition powerseries.hpp:166
Extensions to the Boost.Multiprecision library.
Definition endgames.hpp:44
Definition algorithm_builder.hpp:36
double NumErrorT
The numeric type used to hold error/tolerance magnitudes throughout Bertini2 – tracking tolerances,...
Definition num_traits.hpp:48
boost::multiprecision::number< boost::multiprecision::backends::gmp_rational, boost::multiprecision::et_on > mpq_rational
The exact rational number type.
Definition mpfr_extensions.hpp:55
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:42
detail::TypeList< CauchyConfig, EndgameConfig, SecurityConfig > NeededConfigs
The config types this endgame reads.
Definition config.hpp:206
static constexpr char const * kRecordName
Stable endgame name for records (b2rec ask identity; never typeid).
Definition config.hpp:203
static constexpr char const * kRecordName
Stable endgame name for records (b2rec ask identity; never typeid).
Definition config.hpp:184
PowerSeriesEndgame< PrecT > EmitterType
The event-emitter type for this endgame.
Definition config.hpp:193
detail::TypeList< PowerSeriesConfig, EndgameConfig, SecurityConfig > NeededConfigs
The config types this endgame reads.
Definition config.hpp:187
Definition config.hpp:176
Cauchy-endgame configuration.
Definition config.hpp:142
unsigned int num_consecutive_same_cycle_number
Consecutive identical cycle-number estimates required before trusting convergence (guards against an ...
Definition config.hpp:160
T ratio_cutoff_time
Time below which the c/k ratio test stops.
Definition config.hpp:146
unsigned int fail_safe_maximum_cycle_number
Max number of loops before giving up.
Definition config.hpp:150
NumErrorT T
The numeric (error) type.
Definition config.hpp:143
T maximum_cauchy_ratio
Maximum accepted Cauchy ratio.
Definition config.hpp:149
T cycle_cutoff_time
Time below which the cycle-number heuristic stops.
Definition config.hpp:145
Base empty class.
Definition config.hpp:64
Configuration common to all endgames (sampling and final-approximation tolerances).
Definition config.hpp:103
unsigned int num_needed_for_stabilization
How many consecutive c/k estimates must agree before the path is called to be in the endgame operatin...
Definition config.hpp:128
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
unsigned max_num_refinements
Maximum Newton refinements when sharpening endgame sample points. A tracked sample is already on the ...
Definition config.hpp:111
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
T sample_point_refinement_factor
Extra tolerance for refining sample points before computing the final approximation.
Definition config.hpp:105
bool refine_when_increasing_precision
When true, re-refine retained samples after the endgame migrates to higher precision (default false).
Definition config.hpp:120
T minimum_for_c_over_k_stabilization
How closely successive c/k estimates must agree to count as settled, as a ratio of the smaller to the...
Definition config.hpp:127
NumErrorT T
The numeric (error) type.
Definition config.hpp:104
Facilitates lookup of required endgame type based on tracker type.
Definition config.hpp:86
endgame::CauchyEndgame< EGPrecT > Cauchy
The Cauchy endgame for this tracker.
Definition config.hpp:90
endgame::PowerSeriesEndgame< EGPrecT > PSEG
The power-series endgame for this tracker.
Definition config.hpp:89
typename EGPrecSelector< TrackerT >::type EGPrecT
The precision policy type for the tracker.
Definition config.hpp:87
Power-series-endgame configuration.
Definition config.hpp:134
unsigned max_cycle_number
Largest cycle number to consider.
Definition config.hpp:135
unsigned cycle_number_amplification
Multiplier bounding the search for the cycle number.
Definition config.hpp:136
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
Contains the detail/typelist helper type, for templated getting/setting/storage of config structs.