48inline std::string
FmtReal(R
const& r,
int sig)
50 return (sig > 0) ? r.str(sig) : r.str();
58 const bool re0 = (c.real() == 0), im0 = (c.imag() == 0);
59 if (im0) out <<
FmtReal(c.real(), sig);
60 else if (re0) out <<
FmtReal(c.imag(), sig) <<
"*i";
61 else out <<
"(" <<
FmtReal(c.real(), sig) <<
"+" <<
FmtReal(c.imag(), sig) <<
"*i)";
75 out <<
"..f_" << (row + n - 1);
82 for (
size_t c = 0; c < num_vars && c < vars.size(); ++c)
83 out << (c ?
", " :
"") << *vars[c];
96 const size_t ncol = homogeneous ? num_vars : num_vars + 1;
97 for (
size_t c = 0; c < ncol; ++c)
99 complex_mp const& coeff = M(r,
static_cast<Eigen::Index
>(c));
100 if (coeff.real() == 0 && coeff.imag() == 0)
102 if (!first) out <<
" + ";
107 if (c < num_vars && c < vars.size())
108 out <<
"*" << *vars[c];
Collects the various header files which define the Bertini2 function tree node types.
Definition describe.hpp:38
std::string FmtReal(R const &r, int sig)
Format one multiprecision real part.
Definition describe.hpp:48
void PrintCoeff(std::ostream &out, complex_mp const &c, int sig=0)
Print one (complex_mp) coefficient compactly: a real prints as its real part, a pure imaginary as b*i...
Definition describe.hpp:56
void PrintAugmentedVars(std::ostream &out, VariableGroup const &vars, size_t num_vars, bool homogeneous)
The augmenting variable list [x, y, 1] (affine) or [h, x, y] (homogeneous: no trailing 1).
Definition describe.hpp:79
int CoeffSig(bool verbose)
The significant-digit count for coefficient printing: 4 for terse (short and legible),...
Definition describe.hpp:68
void PrintLinearFormVerbose(std::ostream &out, Mat< complex_mp > const &M, Eigen::Index r, VariableGroup const &vars, size_t num_vars, bool homogeneous)
One affine linear form, row r of an augmented coefficient matrix M (num_vars+1 cols affine,...
Definition describe.hpp:92
constexpr size_t kTerseRowCap
How many function rows a block lists in terse (non-verbose) describe before truncating with a ....
Definition describe.hpp:43
void PrintRowLabel(std::ostream &out, size_t row, size_t n)
f_k for a single row, or f_a..f_b for a contiguous range of n rows starting at row.
Definition describe.hpp:71
Definition blend_block.hpp:75
Definition algorithm_builder.hpp:36
std::vector< std::shared_ptr< node::Variable > > VariableGroup
An ordered group of variables (the unit of homogenization / variable grouping).
Definition node.hpp:69
Eigen::Matrix< NumT, Eigen::Dynamic, Eigen::Dynamic > Mat
A dynamically-sized matrix of NumT.
Definition eigen_extensions.hpp:298
bmp::number< mpc_complex_backend< 0 >, bmp::et_on > complex_mp
The arbitrary-precision complex number type.
Definition mpfr_complex.hpp:58
auto DefaultPrecision()
Get the global default precision (digits) for multiprecision numbers.
Definition mpfr_complex.hpp:135
Provides an Eigen-like NumTraits struct for querying traits of a number type.