34#include <boost/math/special_functions/modf.hpp>
38#include <boost/fusion/adapted.hpp>
39#include <boost/fusion/include/adapted.hpp>
42#define BOOST_SPIRIT_USE_PHOENIX_V3 1
44#include <boost/spirit/include/qi.hpp>
45#include <boost/spirit/include/karma.hpp>
46#include <boost/phoenix/core.hpp>
47#include <boost/phoenix/operator.hpp>
48#include <boost/fusion/include/std_pair.hpp>
51#include <boost/spirit/include/support_istream_iterator.hpp>
74 namespace karma = boost::spirit::karma;
77 template <
typename Num>
81 static int floatfield(Num ) {
return std::ios_base::scientific; }
85 return std::numeric_limits<Num>::max_digits10;
105 template<
typename Num>
106 using FullPrec = boost::spirit::karma::real_generator<Num, BertiniNumPolicy<Num> >;
116 template <
typename OutputIterator>
117 static bool generate(OutputIterator sink,
double const& c)
119 using boost::spirit::karma::omit;
120 using boost::spirit::karma::generate;
136 template <
typename OutputIterator>
137 static bool generate(OutputIterator sink, std::complex<double>
const& c)
139 using boost::spirit::karma::omit;
140 using boost::spirit::karma::generate;
157 template <
typename OutputIterator>
160 using boost::spirit::karma::omit;
161 using boost::spirit::karma::generate;
167 boost::spirit::karma::string
177 template <
typename OutputIterator>
180 using boost::spirit::karma::omit;
181 using boost::spirit::karma::generate;
187 boost::spirit::karma::string <<
" " << boost::spirit::karma::string
191 c.real().str(), c.imag().str()
197 template <
typename OutputIterator,
typename T>
201 for (
decltype(s) ii=0; ii<s; ++ii)
206 boost::spirit::karma::generate(sink, (boost::spirit::karma::char_),
'\n');
219 template <
typename OutputIterator>
220 static bool generate(OutputIterator sink, std::complex<double>
const& c)
222 using boost::spirit::karma::omit;
223 using boost::spirit::karma::generate;
234 c.imag(), c.real(), c.imag()
Bertini extensions of the Eigen linear algebra library.
The main multiprecision complex number type.
Definition generators.hpp:72
FullPrec< real_mp > const full_prec_mp
Full-precision generator for real_mp.
Definition generators.hpp:109
FullPrec< double > const full_prec_d
Full-precision generator for double.
Definition generators.hpp:108
boost::spirit::karma::real_generator< Num, BertiniNumPolicy< Num > > FullPrec
A Karma real generator that emits at full precision using BertiniNumPolicy.
Definition generators.hpp:106
Definition algorithm_builder.hpp:36
Eigen::Matrix< NumT, Eigen::Dynamic, 1 > Vec
A dynamically-sized column vector of NumT.
Definition eigen_extensions.hpp:296
bmp::number< mpc_complex_backend< 0 >, bmp::et_on > complex_mp
The arbitrary-precision complex number type.
Definition mpfr_complex.hpp:58
boost::multiprecision::number< boost::multiprecision::mpfr_float_backend< 0 >, boost::multiprecision::et_on > real_mp
The arbitrary-precision real number type.
Definition mpfr_extensions.hpp:53
static int floatfield(real_mp)
Always format in scientific notation.
Definition generators.hpp:94
static unsigned int precision(real_mp const &x)
Use the value's own precision.
Definition generators.hpp:97
Karma real-number formatting policy: always scientific, at the type's full precision.
Definition generators.hpp:79
static unsigned int precision(Num)
Use the type's maximum decimal digits.
Definition generators.hpp:84
static int floatfield(Num)
Always format in scientific notation.
Definition generators.hpp:81
Generators emitting numbers in C++ source literal format.
Definition generators.hpp:216
static bool generate(OutputIterator sink, std::complex< double > const &c)
Emit a double-precision complex number as a C++ complex literal.
Definition generators.hpp:220
Generators emitting numbers and vectors in classic Bertini format (real then imaginary).
Definition generators.hpp:113
static bool generate(OutputIterator sink, complex_mp const &c)
Emit a multiprecision complex number in classic format.
Definition generators.hpp:178
static bool generate(OutputIterator sink, Vec< T > const &c)
Emit a vector, one entry per line, in classic format.
Definition generators.hpp:198
static bool generate(OutputIterator sink, double const &c)
Emit a double as a classic-format complex (imaginary part zero).
Definition generators.hpp:117
static bool generate(OutputIterator sink, real_mp const &c)
Emit a multiprecision real in classic format.
Definition generators.hpp:158
static bool generate(OutputIterator sink, std::complex< double > const &c)
Emit a double-precision complex number in classic format.
Definition generators.hpp:137