Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
endgames/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) 2015-2021 by 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
22// individual authors of this file include:
23// silviana amethyst, university of wisconsin eau claire
24
25
31
32#pragma once
33
35#include "bertini2/common/config.hpp"
36
37
38namespace bertini{ namespace endgame{
39
40
41 // // some forward declarations
42// base
43 template<class FlavorT, class PrecT>
44 class EndgameBase;
45
46// flavors
47 template<typename PrecT>
49
50 template<typename PrecT>
51 class CauchyEndgame;
52
53// precision types
54 template<typename TrackerT>
55 class FixedPrecEndgame;
56
57 class AMPEndgame;
58
59 // end forward declarations
60
61
62
66 template <typename TrackerT>
68
69 // specialize this in the specific files it goes in, please
70
71
72
73
74
87 template<typename TrackerT>
89 {
90 using EGPrecT = typename EGPrecSelector<TrackerT>::type;
91
94 };
95
96 struct SecurityConfig
97 {
98 int level = 0; //SecurityLevel
99 NumErrorT max_norm = NumErrorT(1e4); //SecurityMaxNorm wrong default value
100 };
101
102
103 struct EndgameConfig
104 {
105 using T = NumErrorT;
106 T sample_point_refinement_factor = 1e-2;
107 unsigned num_sample_points = 3; //NumSamplePoints default = 2
108 T min_track_time = T(1e-100); //nbrh radius in Bertini book. NbhdRadius
109
110 mpq_rational sample_factor = mpq_rational(1,2); //SampleFactor
111
112 unsigned max_num_newton_iterations = 15; // the maximum number allowable iterations during endgames, for points used to approximate the final solution.
113
114 T final_tolerance = 1e-11;
115 };
116
117
118 struct PowerSeriesConfig
119 {
120 unsigned max_cycle_number = 6; //MaxCycleNum
121 unsigned cycle_number_amplification = 5;
122 };
123
124
125 struct CauchyConfig
126 {
127 using T = NumErrorT;
128
129 T cycle_cutoff_time = T(1)/T(100000000); //CycleTimeCutoff
130 T ratio_cutoff_time = T(1)/T(100000000000000); //RatioTimeCutoff
131 T minimum_for_c_over_k_stabilization = T(3)/T(4);
132 unsigned int num_needed_for_stabilization = 3;
133 T maximum_cauchy_ratio = T(1)/T(2);
134 unsigned int fail_safe_maximum_cycle_number = 250; //max number of loops before giving up.
135
136 };
137
138
139 struct TrackBackConfig
140 {
141 unsigned minimum_cycle = 4; //MinCycleTrackback, default = 4
142 bool junk_removal_test = 1; //JunkRemovalTest, default = 1
143 unsigned max_depth_LDT = 3; //MaxLDTDepth, default = 3
144 };
145
146
147 // an empty base class
148 template <typename T>
149 struct AlgoTraits;
150
154 template<typename PrecT>
155 struct AlgoTraits< PowerSeriesEndgame<PrecT>>
156 {
157 using NeededConfigs = detail::TypeList<
158 PowerSeriesConfig,
159 EndgameConfig,
160 SecurityConfig
161 >;
162
163 using EmitterType = PowerSeriesEndgame<PrecT>;
164 };
165
166
170 template<typename PrecT>
171 struct AlgoTraits< CauchyEndgame<PrecT>>
172 {
173 using NeededConfigs = detail::TypeList<
174 CauchyConfig,
175 EndgameConfig,
176 SecurityConfig>;
177 };
178
179
180
181
182} } // namespaces
183
184
Specifies some necessaries for AMP style endgame implementations, which differ from the fixed precisi...
Definition amp_endgame.hpp:52
Class used to finish tracking paths during Homotopy Continuation.
Definition cauchy.hpp:172
class used to finish tracking paths during Homotopy Continuation
Definition powerseries.hpp:172
A basic typelist, in the style of Modern C++ Design, but using variadic templates.
Definition typelist.hpp:46
Definition endgames/config.hpp:67
Facilitates lookup of required endgame type based on tracker type.
Definition endgames/config.hpp:89
Contains the detail/typelist helper type, for templated getting/setting/storage of config structs.