140template <
typename Mat,
141 class RowIndexFormatter,
142 class ColIndexFormatter,
143 class EntryFormatter>
148 const std::string &
prefix =
"",
149 const std::string &
suffix =
"")
152 out <<
"\\begin{tabular}{|c|";
154 for (
long j = 0; j <
m; ++j)
157 out <<
"|} \\hline\n& ";
160 for (
long j = 0; j <
m; ++j)
162 out << ColIndexFormatter()(mat, j);
166 out <<
"\\\\ \\hline\n";
170 for (
long i = 0; i < n; ++i)
172 out << RowIndexFormatter()(mat, i) <<
" & ";
174 for (
long j = 0; j <
m; ++j)
176 out << EntryFormatter()(mat, i, j);
184 out <<
"\\hline\\end{tabular}\n" <<
suffix;
194template <
typename Mat,
195 class RowIndexFormatter,
196 class ColIndexFormatter,
197 class EntryFormatter>
202 const std::string &
prefix =
"",
203 const std::string &
suffix =
"")
205 mat_to_latex<Mat, RowIndexFormatter, ColIndexFormatter, EntryFormatter>(
216template <
typename Mat>
221 return std::to_string(i);
232template <
typename Mat>
237 return std::to_string(j);
249template <
typename Mat>
254 std::ostringstream ss;
275template <
typename Mat>
280 const std::string &
prefix =
"",
281 const std::string &
suffix =
"")
size_t size_t int32_t * out
Main namespace for Aleph-w library functions.
void mat_to_latex(Mat &mat, long n, long m, std::ostream &out, const std::string &prefix="", const std::string &suffix="")
Generate LaTeX tabular representation of a matrix.
void mat_to_latex_simple(Mat &mat, long n, long m, std::ostream &out, const std::string &prefix="", const std::string &suffix="")
Generate LaTeX table with default formatters.
static void suffix(Node *root, DynList< Node * > &acc)
static void prefix(Node *root, DynList< Node * > &acc)
std::string operator()(Mat &mat, long i, long j) const
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)