61 auto emit_groups = [&out](
char const* keyword,
auto const& groups){
62 for (
auto const& grp : groups)
64 out << keyword <<
" ";
65 for (
size_t i = 0; i < grp.size(); ++i)
66 out << (i ?
", " :
"") << *grp[i];
84 std::vector<std::shared_ptr<const node::Node>> roots(functions.begin(), functions.end());
86 out << ne->name() <<
" = " << ne->EntryNode() <<
";\n";
90 for (
size_t i = 0; i < functions.size(); ++i)
91 out << (i ?
", " :
"") <<
"f" << i;
93 for (
size_t i = 0; i < functions.size(); ++i)
94 out <<
"f" << i <<
" = " << functions[i] <<
";\n";
100 std::ostringstream ss;
142 case P::Constant:
return -1;
143 case P::Euler:
return 0;
144 case P::Heun:
return 1;
145 case P::RK4:
return 2;
146 case P::HeunEuler:
return 1;
147 case P::RKNorsett34:
return 4;
148 case P::RKF45:
return 5;
149 case P::RKCashKarp45:
return 6;
150 case P::RKDormandPrince56:
return 7;
151 case P::RKVerner67:
return 8;
162 auto num = [](
double v){ std::ostringstream s; s << std::setprecision(15) << v;
return s.str(); };
163 out <<
"tracktype: " << opt.
tracktype <<
";\n";
164 out <<
"mptype: " << opt.
mptype <<
";\n";
168 out <<
"finaltol: " << num(opt.
finaltol) <<
";\n";
169 out <<
"maxstepsize: " << num(opt.
maxstepsize) <<
";\n";
183 out <<
"degreebound: " << sys.
DegreeBound() <<
";\n";
185 out <<
"% degreebound: omitted -- this system is not polynomial, so it has none\n";
194 out <<
"END;\n\nINPUT\n";
203 std::ostringstream ss;
The fundamental polynomial system class for Bertini2.
Definition system.hpp:106
const Var & GetPathVariable() const
Get the system's path variable (throws if none is defined).
auto HomVariableGroups() const
Get the homogeneous (projective) variable groups in the problem.
Definition system.hpp:1807
Eigen::NumTraits< NumT >::Real CoefficientBound(unsigned num_evaluations=1) const
Compute an estimate of an upper bound of the absolute values of the coefficients in the system.
bool IsPolynomial() const
Checks whether a system is polynomial, overall.
int DegreeBound() const
Compute an upper bound on the degree of the system.
bool HavePathVariable() const
Query whether a path variable is set for this system.
auto VariableGroups() const
Get the affine variable groups in the problem.
Definition system.hpp:1799
std::vector< Nd > NaturalFunctionsAsNodes() const
The system's natural (pre-patch) functions as function-tree expression nodes, expanding any structure...
Discover named nodes of a given kind in a function tree (sympy's find).
Definition classic_writer.hpp:49
void WriteClassicInput(std::ostream &out, System const &sys, ClassicWriteOptions const &opt=ClassicWriteOptions{})
Write a complete Bertini 1 classic input file: CONFIG ... END;\nINPUT ... END;.
Definition classic_writer.hpp:189
std::string SystemToClassicFile(System const &sys, ClassicWriteOptions const &opt=ClassicWriteOptions{})
The complete classic input file as a string.
Definition classic_writer.hpp:200
int PredictorToClassic(tracking::Predictor p)
Map a Bertini 2 Predictor to its Bertini 1 classic odepredictor integer.
Definition classic_writer.hpp:137
std::string SystemToClassic(System const &sys)
The INPUT-section body as a string.
Definition classic_writer.hpp:98
void EmitConfig(std::ostream &out, System const &sys, ClassicWriteOptions const &opt)
Emit the CONFIG-section body (no CONFIG/END wrapper).
Definition classic_writer.hpp:160
void EmitSystem(std::ostream &out, System const &sys)
Emit the INPUT-section body of a system in classic syntax: the variable groups, any named subexpressi...
Definition classic_writer.hpp:59
std::vector< std::shared_ptr< T > > Find(std::shared_ptr< const Node > const &n)
All distinct nodes of kind T in the subtree rooted at n, sorted by name.
Predictor
The predictor (ODE integration) method used during path tracking.
Definition config.hpp:55
Definition algorithm_builder.hpp:36
std::complex< double > complex_dbl
The double-precision complex number type.
Definition double_extensions.hpp:47
Tracking / precision settings to emit in the CONFIG section, in Bertini 1 terms.
Definition classic_writer.hpp:113
double tracktolbeforeeg
Newton tolerance before the endgame.
Definition classic_writer.hpp:117
unsigned stepsforincrease
StepsForIncrease (B2 default 5).
Definition classic_writer.hpp:125
unsigned maxnewtonits
MaxNewtonIts (B2 default 2).
Definition classic_writer.hpp:127
int tracktype
0 = zero-dimensional solve
Definition classic_writer.hpp:114
unsigned long maxnumbersteps
MaxNumberSteps (B2 default 1e5).
Definition classic_writer.hpp:126
int mptype
0 double, 1 fixed-multiple, 2 adaptive
Definition classic_writer.hpp:115
double maxstepsize
MaxStepSize (B2 SteppingConfig default 1/10).
Definition classic_writer.hpp:122
unsigned maxcrossedpathresolves
endgame-boundary crossed-path re-track attempts
Definition classic_writer.hpp:128
double tracktolduringeg
Newton tolerance during the endgame.
Definition classic_writer.hpp:118
double stepsuccessfactor
StepSuccessFactor (B2 default 2).
Definition classic_writer.hpp:123
int odepredictor
5 = RKF45 (the Bertini 2 default)
Definition classic_writer.hpp:116
double finaltol
final tracking tolerance
Definition classic_writer.hpp:119
double stepfailfactor
StepFailFactor (B2 default 1/2).
Definition classic_writer.hpp:124
Provides the bertini::System class.
Configs and settings for tracking.