|
Macaulay2 Engine
|
Generic helpers (displayMat, concatenateMatrices) for DMat / SMat matrices. More...
Go to the source code of this file.
Functions | |
| template<typename Mat> | |
| void | displayMat (buffer &o, const Mat &A) |
| template<typename Mat> | |
| void | displayMat (const Mat &A) |
| template<typename Mat> | |
| static void | concatenateMatrices (const Mat &A, const Mat &B, Mat &C) |
Generic helpers (displayMat, concatenateMatrices) for DMat / SMat matrices.
Collects the templated utilities that do not fit naturally into mat-arith.hpp, mat-elem-ops.hpp, or mat-linalg.hpp. displayMat<Mat>(buffer& o, const Mat& A) walks any duck-typed Mat exposing ElementType, ring(), numRows(), numColumns(), and entry(r, c), builds one per-row sub-buffer, pads each column to the widest entry, marks zero entries with ., and emits the assembled rows through the buffer followed by newline. The one-argument overload displayMat(A) wraps the same routine and flushes via emit from text-io.hpp. Both DMat<R> and SMat<R> satisfy the contract.
The companion concatenateMatrices<Mat>(A, B, C) writes the horizontal join [A | B] into a caller-supplied C (after resizing it to A.numRows() x (A.numColumns() + B.numColumns())), asserting that A and B have the same row count.
Definition in file mat-util.hpp.