7#include <guanaqo/export.h>
32 template <
class U,
class I,
class S>
35 template <
class U,
class I,
class S>
38 template <
class U, std::
size_t E>
60 template <
class U,
class I,
class S>
68 .outer_stride =
static_cast<index_type>(v.outer_stride),
79 std::string_view
end =
"\n";
86template <std::
floating_po
int F>
87GUANAQO_EXPORT std::string_view
89 int precision = std::numeric_limits<F>::max_digits10);
91template <std::
floating_po
int F>
92GUANAQO_EXPORT std::string
93float_to_str(F value,
int precision = std::numeric_limits<F>::max_digits10);
106 PrintMatrixView<const T> M,
107 std::string_view end =
";\n");
110GUANAQO_EXPORT std::ostream &
112 std::string_view end =
"\n",
bool squeeze =
true);
119template <
class T, std::
size_t E>
120std::ostream &
print_csv(std::ostream &os, std::span<T, E> x,
126template <
class T,
class I,
class S, StorageOrder O>
133template <
class T, std::
size_t E>
135 std::string_view end =
";\n") {
140template <
class T,
class I,
class S, StorageOrder O>
142 std::string_view end =
";\n") {
147template <
class T, std::
size_t E>
149 std::string_view end =
"\n",
bool squeeze =
true) {
154template <
class T,
class I,
class S, StorageOrder O>
156 std::string_view end =
"\n",
bool squeeze =
true) {
PrintMatrixView(MatrixView< U, I, S, StorageOrder::ColMajor > v) noexcept
MatrixView< T, index_type, index_type, StorageOrder::ColMajor > view
value_type & operator()(index_type i, index_type j) const noexcept
PrintMatrixView(std::span< U, E > x) noexcept
index_type cols() const noexcept
index_type inner_stride_type
index_type rows() const noexcept
PrintMatrixView(MatrixView< U, I, S, StorageOrder::RowMajor > v) noexcept
PrintMatrixView()=default
PrintMatrixView(MatrixView< U, I, S, StorageOrder::ColMajor > v, bool transposed) noexcept
std::string_view line_start
std::string_view line_end
std::string_view delimiter
std::ostream & print_csv(std::ostream &os, std::span< T, E > x, PrintOpts opts={})
std::string_view float_to_str_vw(std::span< char > buf, F value, int precision=std::numeric_limits< F >::max_digits10)
std::ostream & print_python(std::ostream &os, std::span< T, E > x, std::string_view end="\n", bool squeeze=true)
std::ostream & print_matlab(std::ostream &os, std::span< T, E > x, std::string_view end=";\n")
std::string float_to_str(F value, int precision)
std::ostream & print_csv_impl(std::ostream &os, PrintMatrixView< const T > M, PrintOpts opts)
std::ostream & print_matlab_impl(std::ostream &os, PrintMatrixView< const T > M, std::string_view end)
std::ostream & print_python_impl(std::ostream &os, PrintMatrixView< const T > M, std::string_view end, bool squeeze)
A lightweight view of a 2D matrix.