|
Macaulay2 Engine
|
Matrix — the engine's immutable homomorphism F -> G between free modules. More...
Go to the source code of this file.
Classes | |
| class | Matrix |
| Engine-side matrix: a map between two free modules, stored as a column-vector list. More... | |
| class | Matrix::iterator |
| Reseatable iterator over the non-zero entries of one column of the matrix. More... | |
| class | Matrix::column_iterator |
| Standards-style forward iterator over the vecterms of one column. More... | |
Matrix — the engine's immutable homomorphism F -> G between free modules.
Declares Matrix, an EngineObject whose entries are stored as one vec per column over the target free module. State comprises the target and source FreeModule*s, a single monomial mDegreeShift in the degree monoid applied uniformly to every entry's degree (used by graded computations), and the column array gc_vector<vec> mEntries. Matrix is immutable by design — every "modifying" operation returns a fresh instance — which is what lets the engine share matrices safely and memoise derived data like bases and kernels.
Construction goes through MatrixConstructor (matrix-con.hpp): the actual constructor is private, called only by the builder (FreeModule also friends the class for its own internal needs), so matrices reach the outside world only after degree-compatibility validation. Routine matrix operations (add, subtract, mult, negate, transpose, submatrix, direct_sum, tensor, lead_term, homogenize, ...) live in matrix.cpp; specialised operations are split into matrix-kbasis.cpp, matrix-ncbasis.cpp, matrix-sort.cpp, matrix-stream.cpp, and matrix-symm.cpp. Mutable matrix arithmetic lives in mutablemat.hpp instead.
Definition in file matrix.hpp.