14template <std::
floating_po
int F>
15ALPAQA_EXPORT std::string
16float_to_str(F value,
int precision = std::numeric_limits<F>::max_digits10);
19ALPAQA_EXPORT std::ostream &
20print_csv_impl(std::ostream &os,
const T &M, std::string_view sep =
",",
21 std::string_view begin =
"", std::string_view end =
"\n");
25 std::string_view end =
";\n");
29 std::string_view end =
"\n");
31#define ALPAQA_PRINT_CSV_OVL_IMPL(type) \
32 inline std::ostream &print_csv( \
33 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
34 std::string_view sep, std::string_view begin, std::string_view end) { \
35 return print_csv_impl(os, M, sep, begin, end); \
37 inline std::ostream &print_csv( \
38 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
39 std::string_view sep, std::string_view begin) { \
40 return print_csv_impl(os, M, sep, begin); \
42 inline std::ostream &print_csv( \
43 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
44 std::string_view sep) { \
45 return print_csv_impl(os, M, sep); \
47 inline std::ostream &print_csv( \
48 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M) { \
49 return print_csv_impl(os, M); \
51#define ALPAQA_PRINT_OVL_IMPL(name, type) \
52 inline std::ostream &print_##name( \
53 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
54 std::string_view end) { \
55 return print_##name##_impl(os, M, end); \
57 inline std::ostream &print_##name( \
58 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M) { \
59 return print_##name##_impl(os, M); \
61#define ALPAQA_PRINT_OVL(type) \
62 ALPAQA_PRINT_CSV_OVL_IMPL(type) \
63 ALPAQA_PRINT_OVL_IMPL(matlab, type) \
64 ALPAQA_PRINT_OVL_IMPL(python, type)
69#ifdef ALPAQA_WITH_QUAD_PRECISION
73#undef ALPAQA_PRINT_OVL
74#undef ALPAQA_PRINT_OVL_IMPL
75#undef ALPAQA_PRINT_CSV_OVL_IMPL
std::ostream & print_matlab_impl(std::ostream &os, const T &M, std::string_view end)
std::ostream & print_python_impl(std::ostream &os, const T &M, std::string_view end)
std::string float_to_str(F value, int precision)
std::ostream & print_csv_impl(std::ostream &os, const T &M, std::string_view sep, std::string_view begin, std::string_view end)
#define ALPAQA_PRINT_OVL(type)