139template <
typename Mat,
147 const std::string &
prefix =
"",
148 const std::string &
suffix =
"")
151 out <<
"\\begin{tabular}{|c|";
153 for (
long j = 0; j < m; ++j)
156 out <<
"|} \\hline\n& ";
159 for (
long j = 0; j < m; ++j)
165 out <<
"\\\\ \\hline\n";
169 for (
long i = 0; i < n; ++i)
173 for (
long j = 0; j < m; ++j)
183 out <<
"\\hline\\end{tabular}\n" <<
suffix;
193template <
typename Mat,
201 const std::string &
prefix =
"",
202 const std::string &
suffix =
"")
215template <
typename Mat>
220 return std::to_string(i);
231template <
typename Mat>
236 return std::to_string(j);
248template <
typename Mat>
253 std::ostringstream
ss;
274template <
typename Mat>
279 const std::string &
prefix =
"",
280 const std::string &
suffix =
"")
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)
DynList< T > maps(const C &c, Op op)
Classic map operation.
std::string operator()(Mat &mat, long i, long j) const