Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
Loading...
Searching...
No Matches
nag_algorithms/common/config.hpp
1//This file is part of Bertini 2.
2//
3//nag_algorithms/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//nag_algorithms/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 nag_algorithms/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// Tim Hodges, Colorado State University
25// jeb collins, west texas a&m
26
27#pragma once
28
31
32namespace bertini{
33 namespace algorithm{
34
35template<typename T>
36using SolnCont = std::vector<T>;
37
38namespace classic{
39
40enum class AlgoChoice
41{
42 EvalFunctions = -4,
43 EvalFunctionJacobian = -3,
44 NewtonIteration = -2,
45 NewtonIterationCondNum = -1,
46 ZeroDim = 0,
47 NID = 1,
48 SampleComponent = 2,
49 MembershipTest = 3,
50 ExtractWitnessSet = 4,
51 WitnessSetProjection = 5,
52 IsosingularStab = 6
53};
54
55} // namespace classic
56
57
58
59struct TolerancesConfig
60{
61 using T = NumErrorT;
62
63 T newton_before_endgame = T(1)/T(100000); //E.4.1
64 T newton_during_endgame = T(1)/T(1000000); //E.4.2
65
66 T final_tolerance = T(1)/T(100000000000); //E.5.1
67
68 T path_truncation_threshold = T(100000); //E.4.13
69};
70
71
72struct MidPathConfig
73{
74 using T = NumErrorT;
75
76 T same_point_tolerance = T(1)/T(100000);
77};
78
79
80
81struct AutoRetrackConfig
82{
83 using T = NumErrorT;
84
85 T midpath_decrease_tolerance_factor = T(1)/T(2);
86};
87
88
89
90struct SharpeningConfig
91{
92 using T = NumErrorT;
93
94 unsigned sharpendigits;
95
96 // std::function<Vec<T>> sharpen_method_; ///< function taking a vector, and sharpening it.
97
98 T function_residual_tolerance = Eigen::NumTraits<T>::dummy_precision();
99
100 T ratio_tolerance = T(99)/T(100);
101};
102
103
104
105struct RegenerationConfig
106{
107 using T = NumErrorT;
108
109 bool remove_infinite_endpoints = true;
110
111 bool higher_dimension_check = true;
112 unsigned start_level = 0;
113 T newton_before_endgame;
114 T newton_during_endgame;
115 T final_tolerance;
116};
117
118
119
120struct PostProcessingConfig{
121 using T = NumErrorT;
122
123 T real_threshold = T(1)/T(100000000);
124
125 T endpoint_finite_threshold = T(1)/T(100000);
126
127 T same_point_tolerance {T(1)/T(10000000000)};
128};
129
130template<typename ComplexT>
131struct ZeroDimConfig
132{
133 unsigned initial_ambient_precision = DoublePrecision();
134 unsigned max_num_crossed_path_resolve_attempts = 2;
135
136 ComplexT start_time = ComplexT(1);
137 ComplexT endgame_boundary = ComplexT(1)/ComplexT(10);
138 ComplexT target_time = ComplexT(0);
139
140 std::string path_variable_name = "ZERO_DIM_PATH_VARIABLE";
141};
142
143struct MetaConfig
144{
145 classic::AlgoChoice tracktype = classic::AlgoChoice::ZeroDim;
146};
147
148
149// a forward declare
150template <typename T>
151 struct AlgoTraits;
152
153
154} } // namespaces
Provides some policies for the zero dim algorithm.
Aggregate include for the various start systems in Bertini2.