15template <std::
floating_po
int F>
16ALPAQA_EXPORT std::string
17float_to_str(F value,
int precision = std::numeric_limits<F>::max_digits10);
20ALPAQA_EXPORT std::ostream &
21print_csv_impl(std::ostream &os,
const T &M, std::string_view sep =
",",
22 std::string_view begin =
"", std::string_view end =
"\n");
26 std::string_view end =
";\n");
30 std::string_view end =
"\n");
32#define ALPAQA_PRINT_CSV_OVL_IMPL(type) \
33 inline std::ostream &print_csv( \
34 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
35 std::string_view sep, std::string_view begin, std::string_view end) { \
36 return print_csv_impl(os, M, sep, begin, end); \
38 inline std::ostream &print_csv( \
39 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
40 std::string_view sep, std::string_view begin) { \
41 return print_csv_impl(os, M, sep, begin); \
43 inline std::ostream &print_csv( \
44 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
45 std::string_view sep) { \
46 return print_csv_impl(os, M, sep); \
48 inline std::ostream &print_csv( \
49 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M) { \
50 return print_csv_impl(os, M); \
52#define ALPAQA_PRINT_OVL_IMPL(name, type) \
53 inline std::ostream &print_##name( \
54 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M, \
55 std::string_view end) { \
56 return print_##name##_impl(os, M, end); \
58 inline std::ostream &print_##name( \
59 std::ostream &os, const Eigen::Ref<const Eigen::MatrixX<type>> &M) { \
60 return print_##name##_impl(os, M); \
62#define ALPAQA_PRINT_OVL(type) \
63 ALPAQA_PRINT_CSV_OVL_IMPL(type) \
64 ALPAQA_PRINT_OVL_IMPL(matlab, type) \
65 ALPAQA_PRINT_OVL_IMPL(python, type)
70#ifdef ALPAQA_WITH_QUAD_PRECISION
74#undef ALPAQA_PRINT_OVL
75#undef ALPAQA_PRINT_OVL_IMPL
76#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)